Class DefaultSerializer
The default serializer used.
Uses the Newtonsoft.JSON library.
Implements
Inherited Members
Namespace: MercadoPago.Serialization
Assembly: MercadoPago.dll
Syntax
public class DefaultSerializer : ISerializer
Constructors
| Edit this page View SourceDefaultSerializer()
Initializes a new instance of the DefaultSerializer class.
Declaration
public DefaultSerializer()
Properties
| Edit this page View SourceJsonSerializer
JsonSerializer user by the serializer.
Declaration
public JsonSerializer JsonSerializer { get; }
Property Value
| Type | Description |
|---|---|
| JsonSerializer |
JsonSerializerSettings
JsonSerializerSettings used to serialize and deserialize.
Declaration
public JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
| Type | Description |
|---|---|
| JsonSerializerSettings |
Methods
| Edit this page View SourceDeserializeFromJson<TResponse>(string)
Deserialize the JSON string as a object.
Declaration
public TResponse DeserializeFromJson<TResponse>(string json) where TResponse : new()
Parameters
| Type | Name | Description |
|---|---|---|
| string | json | The JSON string. |
Returns
| Type | Description |
|---|---|
| TResponse | The deserialized object from the JSON string. |
Type Parameters
| Name | Description |
|---|---|
| TResponse | The type of response object. |
SerializeToJson(object)
Serializes the request object as a JSON string.
Declaration
public string SerializeToJson(object request)
Parameters
| Type | Name | Description |
|---|---|---|
| object | request | The request object. |
Returns
| Type | Description |
|---|---|
| string | The serialized request as a JSON string. |
SerializeToQueryStringAsync(object)
Serializes the request object as query string parameters.
Declaration
public Task<string> SerializeToQueryStringAsync(object request)
Parameters
| Type | Name | Description |
|---|---|---|
| object | request | The request object. |
Returns
| Type | Description |
|---|---|
| Task<string> | A task whose result is the serialized request as query string parameters. |