JsonResult<T> Constructor
Namespace: System.Web.Http.Results
Assembly: System.Web.Http (in System.Web.Http.dll)
Overload List
Name | Description | |
---|---|---|
JsonResult<T>(T, JsonSerializerSettings, Encoding, ApiController) | Initializes a new instance of the JsonResult<T> class with the values provided. |
|
JsonResult<T>(T, JsonSerializerSettings, Encoding, HttpRequestMessage) | Initializes a new instance of the JsonResult<T> class with the values provided. |
See Also
JsonResult<T> Class
System.Web.Http.Results Namespace
Return to top
JsonResult<T> Constructor (T, JsonSerializerSettings, Encoding, ApiController)
Initializes a new instance of the JsonResult<T> class with the values provided.
Syntax
public JsonResult(
T content,
JsonSerializerSettings serializerSettings,
Encoding encoding,
ApiController controller
)
public:
JsonResult(
T content,
JsonSerializerSettings^ serializerSettings,
Encoding^ encoding,
ApiController^ controller
)
new :
content:'T *
serializerSettings:JsonSerializerSettings *
encoding:Encoding *
controller:ApiController -> JsonResult
Public Sub New (
content As T,
serializerSettings As JsonSerializerSettings,
encoding As Encoding,
controller As ApiController
)
Parameters
content
Type: TThe content value to serialize in the entity body.
serializerSettings
Type: Newtonsoft.Json.JsonSerializerSettingsThe serializer settings.
encoding
Type: System.Text.EncodingThe content encoding.
controller
Type: System.Web.Http.ApiControllerThe controller from which to obtain the dependencies needed for execution.
Return to top
JsonResult<T> Constructor (T, JsonSerializerSettings, Encoding, HttpRequestMessage)
Initializes a new instance of the JsonResult<T> class with the values provided.
Syntax
public JsonResult(
T content,
JsonSerializerSettings serializerSettings,
Encoding encoding,
HttpRequestMessage request
)
public:
JsonResult(
T content,
JsonSerializerSettings^ serializerSettings,
Encoding^ encoding,
HttpRequestMessage^ request
)
new :
content:'T *
serializerSettings:JsonSerializerSettings *
encoding:Encoding *
request:HttpRequestMessage -> JsonResult
Public Sub New (
content As T,
serializerSettings As JsonSerializerSettings,
encoding As Encoding,
request As HttpRequestMessage
)
Parameters
content
Type: TThe content value to serialize in the entity body.
serializerSettings
Type: Newtonsoft.Json.JsonSerializerSettingsThe serializer settings.
encoding
Type: System.Text.EncodingThe content encoding.
request
Type: System.Net.Http.HttpRequestMessageThe request message which led to this result.
Return to top