Class DefaultResponseSerializer
Serializer for basic responses that don't have binary data.
Inheritance
DefaultResponseSerializer
Implements
Namespace: TehGM.Wolfringo.Messages.Serialization
Assembly: Wolfringo.Core.dll
Syntax
public class DefaultResponseSerializer : IResponseSerializer
Methods
| Improve this Doc View SourceDeserialize(Type, SerializedMessageData)
Deserialize a server response.
Declaration
public virtual IWolfResponse Deserialize(Type responseType, SerializedMessageData responseData)
Parameters
Type | Name | Description |
---|---|---|
Type | responseType | Type of the response to deserialize into. |
SerializedMessageData | responseData | Serialized response data. |
Returns
Type | Description |
---|---|
IWolfResponse | Deserialized response. |
GetResponseJson(JToken)
Gets response json, stripping off wrapping array.
Declaration
protected static JToken GetResponseJson(JToken payload)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.Linq.JToken | payload | JSON response payload. |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Linq.JToken | Core response payload. |
GetResponseJson(SerializedMessageData)
Gets response json, stripping off wrapping array.
Declaration
protected static JToken GetResponseJson(SerializedMessageData responseData)
Parameters
Type | Name | Description |
---|---|---|
SerializedMessageData | responseData | Serialized response data. |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Linq.JToken | Core response payload. |
ThrowIfInvalidType(Type)
Throws if response type is not supported by this serializer.
Declaration
protected virtual void ThrowIfInvalidType(Type responseType)
Parameters
Type | Name | Description |
---|---|---|
Type | responseType | Type of the response. |