With ASP.NET MVC 5, you can skip the ugly "ActionResult" return type, and instead, specify a 'real' class. However, it seems that MVC wants to return the .ToString()
version of my object as Content
instead of the JSON serialized version of my object that I want - similar to ASP.NET MVC WebApi2.
Given this controller... how do I get a JSON result without changing the method at all?
public class MyController : Controller
{
public Thing GetSomething()
{
return new Thing { Name = "Justin_Example" };
}
}