JsonResult Klasa

Definicja

Wynik akcji, który formatuje dany obiekt w formacie JSON.

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

Konstruktory

JsonResult(Object)

Tworzy nowy JsonResult element z danym valueelementem .

JsonResult(Object, JsonSerializerSettings)

Tworzy nowy JsonResult element z danym valueelementem .

JsonResult(Object, Object)

Tworzy nowy JsonResult element z danym valueelementem .

Właściwości

ContentType

Pobiera lub ustawia MediaTypeHeaderValue reprezentujący nagłówek Content-Type odpowiedzi.

SerializerSettings

Pobiera lub ustawia ustawienia serializatora.

W przypadku korzystania z programu System.Text.Jsonpowinno to być wystąpienie klasy JsonSerializerOptions

W przypadku korzystania z programu Newtonsoft.Jsonpowinno to być wystąpienie klasy JsonSerializerSettings.

StatusCode

Pobiera lub ustawia kod stanu HTTP.

Value

Pobiera lub ustawia wartość do sformatowania.

Metody

ExecuteResult(ActionContext)

Wykonuje operację wyniku metody akcji synchronicznie. Ta metoda jest wywoływana przez MVC w celu przetworzenia wyniku metody akcji.

(Odziedziczone po ActionResult)
ExecuteResultAsync(ActionContext)

Wykonuje operację wynikową metody akcji asynchronicznie. Ta metoda jest wywoływana przez MVC w celu przetworzenia wyniku metody akcji.

Dotyczy