private static void ConfigHalJson(this HttpConfiguration config) { var jsonFormatter = new JsonHalMediaTypeFormatter() { SerializerSettings = { ContractResolver = new CamelCasePropertyNamesContractResolver() } }; config.Formatters.Add(jsonFormatter); }
public void Initialize(HttpControllerSettings controllerSettings, HttpControllerDescriptor controllerDescriptor) { controllerSettings.Formatters.Insert(0, new XmlHalMediaTypeFormatter()); var jsonFormatter = new JsonHalMediaTypeFormatter { SerializerSettings = { ContractResolver = new CamelCasePropertyNamesContractResolver() } }; controllerSettings.Formatters.Insert(0, jsonFormatter); //controllerSettings.Services.Replace(typeof (IHttpActionSelector), new CustomActionSelector()); }