What is difference between ObjectResult and JsonResult
问题 There are two classes in Microsoft.AspNetCore.Mvc namespace: ObjectResult and JsonResult . Both convert the returned object in the JSON format. What is difference between them and what is the purpose to use them? 回答1: JsonResult is an IActionResult which formats the given object as JSON ObjectResult is an IActionResult that has content negotiation built in. Inside its ExecuteResultAsync , responsible for writing to the response stream, the framework will walk through the available formatters