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
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour