Share via


JsonResult 建構函式

定義

多載

JsonResult(Object)

使用指定的 value 建立新的 JsonResult

JsonResult(Object, JsonSerializerSettings)

使用指定的 value 建立新的 JsonResult

JsonResult(Object, Object)

使用指定的 value 建立新的 JsonResult

JsonResult(Object)

來源:
JsonResult.cs
來源:
JsonResult.cs

使用指定的 value 建立新的 JsonResult

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)

參數

value
Object

要格式化為 JSON 的值。

適用於

JsonResult(Object, JsonSerializerSettings)

來源:
JsonResult.cs
來源:
JsonResult.cs

使用指定的 value 建立新的 JsonResult

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)

參數

value
Object

要格式化為 JSON 的值。

serializerSettings
Newtonsoft.Json.JsonSerializerSettings

Newtonsoft.Json.JsonSerializerSettings要供格式器使用的 。

適用於

JsonResult(Object, Object)

使用指定的 value 建立新的 JsonResult

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)

參數

value
Object

要格式化為 JSON 的值。

serializerSettings
Object

格式器要使用的序列化程式設定。

使用 System.Text.Json 時,這應該是 的 JsonSerializerOptions 實例。

使用 Newtonsoft.Json 時,這應該是 的 JsonSerializerSettings 實例。

適用於