ApiController::Json Method
Assembly: System.Web.Http (in System.Web.Http.dll)
| Name | Description | |
|---|---|---|
![]() | Json<T>(T) | Creates a JsonResult<T> (200 OK) with the specified value. |
![]() | Json<T>(T, JsonSerializerSettings^) | Creates a JsonResult<T> (200 OK) with the specified values. |
![]() | Json<T>(T, JsonSerializerSettings^, Encoding^) | Creates a JsonResult<T> (200 OK) with the specified values. |
ApiController::Json<T> Method (T)
Creates a JsonResult<T> (200 OK) with the specified value.
Parameters
- content
-
Type:
T
The content value to serialize in the entity body.
Type Parameters
- T
The type of content in the entity body.
ApiController::Json<T> Method (T, JsonSerializerSettings^)
Creates a JsonResult<T> (200 OK) with the specified values.
public protected: generic<typename T> JsonResult<T>^ Json( T content, JsonSerializerSettings^ serializerSettings )
Parameters
- content
-
Type:
T
The content value to serialize in the entity body.
- serializerSettings
-
Type:
Newtonsoft.Json::JsonSerializerSettings^
The serializer settings.
Return Value
Type: System.Web.Http.Results::JsonResult<T>^A JsonResult<T> with the specified values.
Type Parameters
- T
The type of content in the entity body.
ApiController::Json<T> Method (T, JsonSerializerSettings^, Encoding^)
Creates a JsonResult<T> (200 OK) with the specified values.
public protected: generic<typename T> virtual JsonResult<T>^ Json( T content, JsonSerializerSettings^ serializerSettings, Encoding^ encoding )
Parameters
- content
-
Type:
T
The content value to serialize in the entity body.
- serializerSettings
-
Type:
Newtonsoft.Json::JsonSerializerSettings^
The serializer settings.
- encoding
-
Type:
System.Text::Encoding^
The content encoding.
Return Value
Type: System.Web.Http.Results::JsonResult<T>^A JsonResult<T> with the specified values.
Type Parameters
- T
The type of content in the entity body.
