Class JsonSerializer
Default implementation of the IJsonSerializer interface. Inherit or nest and instance of this class and override its methods to allow inspection of payload.
Inheritance
System.Object
JsonSerializer
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Klarna.Rest.Core.Serialization
Assembly: Klarna.Rest.Core.dll
Syntax
public class JsonSerializer : IJsonSerializer
Fields
| Improve this Doc View SourceSerializerSettings
Default json serialization settings for the Klarna API
Declaration
protected JsonSerializerSettings SerializerSettings
Field Value
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializerSettings |
Methods
| Improve this Doc View SourceDeserialize<T>(String)
Should deserialize the json data to object of type T.
Declaration
public T Deserialize<T>(string json)
Parameters
Type | Name | Description |
---|---|---|
System.String | json | Json data to deserialize |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | Objec Type to deserialize into |
Serialize(Object)
Should serialize the input object to json data
Declaration
public string Serialize(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The object to serialize |
Returns
Type | Description |
---|---|
System.String |