JsonResult Sınıf

Tanım

Verilen nesneyi JSON olarak biçimlendiren bir eylem sonucu.

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
Devralma
JsonResult
Uygulamalar

Oluşturucular

JsonResult(Object)

Verilen ile yeni bir oluşturur JsonResult value .

JsonResult(Object, JsonSerializerSettings)

Verilen ile yeni bir oluşturur JsonResult value .

JsonResult(Object, Object)

Verilen ile yeni bir oluşturur JsonResult value .

Özellikler

ContentType

MediaTypeHeaderValueYanıtın Content-Type üst bilgisini temsil eden alır veya ayarlar.

SerializerSettings

Seri hale getirici ayarlarını alır veya ayarlar.

System. Text. JSONkullanılırken bu bir örneği olmalıdırJsonSerializerOptions

Newtonsoft. JSONkullanılırken, bu jsonserializersettings'in bir örneği olmalıdır.

StatusCode

HTTP durum kodunu alır veya ayarlar.

Value

Biçimlendirilecek değeri alır veya ayarlar.

Yöntemler

ExecuteResult(ActionContext)

Eylem yönteminin sonuç işlemi zaman uyumlu olarak yürütür. Bu yöntem, bir eylem yönteminin sonucu işlemesi için MVC tarafından çağrılır.

(Devralındığı yer: ActionResult)
ExecuteResultAsync(ActionContext)

Eylem yönteminin sonuç işlemini zaman uyumsuz olarak yürütür. Bu yöntem, bir eylem yönteminin sonucunu işlemek için MVC tarafından çağırılır.

Şunlara uygulanır