Partager via


JsonResult<T> Constructor

 

Namespace:   System.Web.Http.Results
Assembly:  System.Web.Http (in System.Web.Http.dll)

Overload List

Name Description
System_CAPS_pubmethod JsonResult<T>(T, JsonSerializerSettings, Encoding, ApiController)

Initializes a new instance of the JsonResult<T> class with the values provided.

System_CAPS_pubmethod 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: T

    The content value to serialize in the entity body.

  • serializerSettings
    Type: Newtonsoft.Json.JsonSerializerSettings

    The serializer settings.

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: T

    The content value to serialize in the entity body.

  • serializerSettings
    Type: Newtonsoft.Json.JsonSerializerSettings

    The serializer settings.

Return to top