Dela via


JsonResult Constructors

Definition

Overloads

JsonResult(Object)

Creates a new JsonResult with the given value.

JsonResult(Object, JsonSerializerSettings)

Creates a new JsonResult with the given value.

JsonResult(Object, Object)

Creates a new JsonResult with the given value.

JsonResult(Object)

Source:
JsonResult.cs
Source:
JsonResult.cs
Source:
JsonResult.cs

Creates a new JsonResult with the given value.

public:
 JsonResult(System::Object ^ value);
public JsonResult (object value);
public JsonResult (object? value);
new Microsoft.AspNetCore.Mvc.JsonResult : obj -> Microsoft.AspNetCore.Mvc.JsonResult
Public Sub New (value As Object)

Parameters

value
Object

The value to format as JSON.

Applies to

JsonResult(Object, JsonSerializerSettings)

Source:
JsonResult.cs
Source:
JsonResult.cs

Creates a new JsonResult with the given value.

public:
 JsonResult(System::Object ^ value, Newtonsoft::Json::JsonSerializerSettings ^ serializerSettings);
public JsonResult (object value, Newtonsoft.Json.JsonSerializerSettings serializerSettings);
new Microsoft.AspNetCore.Mvc.JsonResult : obj * Newtonsoft.Json.JsonSerializerSettings -> Microsoft.AspNetCore.Mvc.JsonResult
Public Sub New (value As Object, serializerSettings As JsonSerializerSettings)

Parameters

value
Object

The value to format as JSON.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings

The Newtonsoft.Json.JsonSerializerSettings to be used by the formatter.

Applies to

JsonResult(Object, Object)

Source:
JsonResult.cs

Creates a new JsonResult with the given value.

public:
 JsonResult(System::Object ^ value, System::Object ^ serializerSettings);
public JsonResult (object value, object serializerSettings);
public JsonResult (object? value, object? serializerSettings);
new Microsoft.AspNetCore.Mvc.JsonResult : obj * obj -> Microsoft.AspNetCore.Mvc.JsonResult
Public Sub New (value As Object, serializerSettings As Object)

Parameters

value
Object

The value to format as JSON.

serializerSettings
Object

The serializer settings to be used by the formatter.

When using System.Text.Json, this should be an instance of JsonSerializerOptions.

When using Newtonsoft.Json, this should be an instance of JsonSerializerSettings.

Applies to