标签:map icon nal sax bapi style cti 目录 option
配置WebApiConfig:
Global.asax 添加
GlobalConfiguration.Configure(WebApiConfig.Register);
WebApiConfig配置
public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.MapHttpAttributeRoutes(); //WebApi areas 中api路径 config.Routes.MapHttpRoute( name: "DefaultApi2", routeTemplate: "api/{area}/{controller}/{action}/{id}", defaults: new { action = "Index", id = RouteParameter.Optional } ); //根目录Controllers中api路径 config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { action = "Index", id = RouteParameter.Optional } ); } }
标签:map icon nal sax bapi style cti 目录 option
原文地址:http://www.cnblogs.com/OleRookie/p/6617169.html