How can I take control of the JSON serialization and not have web API serialize my model?
Currently the resulting string is double serialized because I am doing it AND web api is performing it.
public HttpResponseMessage GetUsers()
{
var users = _service.GetUsers()
var model = new UserResponse(users);
var json = JsonConvert.SerializeObject(model);
return Request.CreateResponse(HttpStatusCode.OK, json, Configuration.Formatters.JsonFormatter);
}
I am going to add some customization so I need to take control of this JSON serialization part.