Given the following class,
public class Result
{
public bool Success { get; set; }
public string Message { get; set; }
}
I a
Though it is an old question, hope below code snippet will be helpful to others,
I did below with MVC5 Web API.
public JsonResult Post(Request request)
{
var response = new Response();
//YOUR LOGIC IN THE METHOD
//.......
//.......
return Json(response, new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver() });
}