В App_Start/WebApiConfig.cs в метод Register добавляем
var appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "application/xml");
config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType);
var jsonFormatter = config.Formatters.OfType<JsonMediaTypeFormatter>().FirstOrDefault();
if (jsonFormatter != null)
jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
в контроллере
public IQueryable<Order> GetOrders()
{
return _db.Orders;
}
Все.