I want to be able to get the result that the ActionResult will generate directly in my controller for debugging purposes. How do I do that?
Something like:
public ActionResult Parts(string id)
{
var parts = _repository.GetParts(id);
var action = Json(parts);
var generatedJson = XXXXX;
return action;
}
For debugging purposes you definitely want to use a debugging tool such as FireBug or Fiddler, but if you insist
pollutingmodifying your source code when in Debug mode you could take a look at the JavaScriptSerializer class (which is internally used by the JsonResult class):