WebOperationContext.CreateJsonResponse Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET