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。我是在做一些愚蠢的事情還是需要做一些額外的步驟?