Modifica

Condividi tramite


WebOperationContext.CreateJsonResponse Method

Definition

Creates a message in JSON format.

Overloads

CreateJsonResponse<T>(T)

Creates a JSON formatted message.

CreateJsonResponse<T>(T, DataContractJsonSerializer)

Creates a JSON formatted message.

CreateJsonResponse<T>(T)

Creates a JSON formatted message.

public:
generic <typename T>
 System::ServiceModel::Channels::Message ^ CreateJsonResponse(T instance);
public System.ServiceModel.Channels.Message CreateJsonResponse<T> (T instance);
member this.CreateJsonResponse : 'T -> System.ServiceModel.Channels.Message
Public Function CreateJsonResponse(Of T) (instance As T) As Message

Type Parameters

T

The type of object to write to the message.

Parameters

instance
T

The object to write to the message.

Returns

A JSON formatted message.

Applies to

CreateJsonResponse<T>(T, DataContractJsonSerializer)

Creates a JSON formatted message.

public:
generic <typename T>
 System::ServiceModel::Channels::Message ^ CreateJsonResponse(T instance, System::Runtime::Serialization::Json::DataContractJsonSerializer ^ serializer);
public System.ServiceModel.Channels.Message CreateJsonResponse<T> (T instance, System.Runtime.Serialization.Json.DataContractJsonSerializer serializer);
member this.CreateJsonResponse : 'T * System.Runtime.Serialization.Json.DataContractJsonSerializer -> System.ServiceModel.Channels.Message
Public Function CreateJsonResponse(Of T) (instance As T, serializer As DataContractJsonSerializer) As Message

Type Parameters

T

The type of object to write to the message.

Parameters

instance
T

The object to write to the message.

serializer
DataContractJsonSerializer

The serializer to use.

Returns

A JSON formatted message.

Applies to