Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ApiController::Json Method

 

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

NameDescription
System_CAPS_protmethodJson<T>(T)

Creates a JsonResult<T> (200 OK) with the specified value.

System_CAPS_protmethodJson<T>(T, JsonSerializerSettings^)

Creates a JsonResult<T> (200 OK) with the specified values.

System_CAPS_protmethodJson<T>(T, JsonSerializerSettings^, Encoding^)

Creates a JsonResult<T> (200 OK) with the specified values.

Return to top

ApiController::Json<T> Method (T)

Creates a JsonResult<T> (200 OK) with the specified value.

public protected:
generic<typename T>
JsonResult<T>^ Json(
	T content
)

Parameters

content
Type: T

The content value to serialize in the entity body.

Return Value

Type: System.Web.Http.Results::JsonResult<T>^

A JsonResult<T> with the specified value.

Type Parameters

T

The type of content in the entity body.

Return to top

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.

Return to top

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.

Return to top
Show: