JsonResult Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
JsonResult(Object) |
Creates a new JsonResult with the given |
JsonResult(Object, JsonSerializerSettings) |
Creates a new JsonResult with the given |
JsonResult(Object, Object) |
Creates a new JsonResult with the given |
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
.