Class MarketConverter

This type/member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Converts an IMarket object to json and back.

Inheritance
System.Object
MarketConverter
Namespace: EPiServer.Commerce.Order.Internal.Serialization
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0
Syntax
public class MarketConverter : JsonConverter

Constructors

MarketConverter()

Initializes a new instance of the MarketConverter class.

Declaration
public MarketConverter()

MarketConverter(IMarketService)

Initializes a new instance of the MarketConverter class.

Declaration
public MarketConverter(IMarketService marketService)
Parameters
Type Name Description
IMarketService marketService

The market service.

Methods

CanConvert(Type)

Determines whether this converter can convert the specified object type.

Declaration
public override bool CanConvert(Type objectType)
Parameters
Type Name Description
System.Type objectType

Type of the object.

Returns
Type Description
System.Boolean

true if this converter can convert the specified object type; otherwise, false.

ReadJson(JsonReader, Type, Object, JsonSerializer)

Deserializes a IMarket instance from json.

Declaration
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Parameters
Type Name Description
Newtonsoft.Json.JsonReader reader

The reader.

System.Type objectType

Type of the object.

System.Object existingValue

The existing value.

Newtonsoft.Json.JsonSerializer serializer

The serializer.

Returns
Type Description
System.Object

The market.

WriteJson(JsonWriter, Object, JsonSerializer)

Serializes a IMarket instance to json.

Declaration
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
Parameters
Type Name Description
Newtonsoft.Json.JsonWriter writer

The writer.

System.Object value

The value.

Newtonsoft.Json.JsonSerializer serializer

The serializer.