I created custom ActionResult (simplified):
public class FastJSONResult : ActionResult
{
public string JsonData { get; private set; }
public FastJSONResult(object data)
{
JsonData = JSON.Instance.ToJSON(data);
}
public override void ExecuteResult(ControllerContext context)
{
HttpResponseBase response = context.HttpContext.Response;
response.ContentType = "application/json";
response.Output.Write(JsonData);
}
}
And use it from my WebApi controller:
public ActionResult GetReport()
{
var report = new Report();
return new FastJSONResult(report);
}
Now the problem is, despite the fact that in FastJSONResult constructor my object serializes perfectly, ExecuteResult never gets called and in response I end up with object like
{"JsonData":"{my json object as a string value}"}
What am I doing wrong?

return Json(report, JsonRequestBehavior.AllowGet);. Have you tried that?