Web API Media Type Formatter

public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);

config.Formatters.JsonFormatter.SerializerSettings.Formatting = Newtonsoft.Json.Formatting.Indented;
config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
}

 

//上面的两句话的作用是formation 和 属性是camelCase形式

Web API Media Type Formatter

 

Web API Media Type Formatter

上一篇:简单安装windows terminal和在window10开启Ubuntu bash的方法


下一篇:windows常用快捷键