JsonResult JsonResult JsonResult Class

Definition

An action result which formats the given object as JSON.

public class JsonResult : Microsoft.AspNetCore.Mvc.ActionResult, Microsoft.AspNetCore.Mvc.IActionResult, Microsoft.AspNetCore.Mvc.Infrastructure.IStatusCodeActionResult
type JsonResult = class
    inherit ActionResult
    interface IStatusCodeActionResult
    interface IActionResult
Public Class JsonResult
Inherits ActionResult
Implements IActionResult, IStatusCodeActionResult
Inheritance
Implements

Constructors

JsonResult(Object) JsonResult(Object) JsonResult(Object)

Creates a new JsonResult with the given value.

JsonResult(Object, JsonSerializerSettings) JsonResult(Object, JsonSerializerSettings) JsonResult(Object, JsonSerializerSettings)

Creates a new JsonResult with the given value.

Properties

ContentType ContentType ContentType

Gets or sets the MediaTypeHeaderValue representing the Content-Type header of the response.

SerializerSettings SerializerSettings SerializerSettings

Gets or sets the Newtonsoft.Json.JsonSerializerSettings.

StatusCode StatusCode StatusCode

Gets or sets the HTTP status code.

Value Value Value

Gets or sets the value to be formatted.

Methods

ExecuteResult(ActionContext) ExecuteResult(ActionContext) ExecuteResult(ActionContext)

Executes the result operation of the action method synchronously. This method is called by MVC to process the result of an action method.

(Inherited from ActionResult)
ExecuteResultAsync(ActionContext) ExecuteResultAsync(ActionContext) ExecuteResultAsync(ActionContext)

Applies to