0
我有一个WebApi项目,我正在尝试向它添加一个区域。WebApi未找到区域
在向webapi项目和mvc4应用程序添加新区域时是否需要完成不同的工作?
我有一个简单区域注册等
public class MobileAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Mobile";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Mobile_default",
"Mobile/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
}
控制器等
public class BusinessDetailsController : BaseController
{
public string Index()
{
return "hello world";
}
public HttpResponseMessage Get()
{
var data = new List<string> {"Store 1", "Store 2", "Store 3"};
return Request.CreateResponse(HttpStatusCode.OK, data);
}
}
但是我永远不能达到API。我是在做一些愚蠢的事情还是需要做一些额外的步骤?