For Babelfish Release 1.11.1.3

ScoreHistoryBaseConverter Class

Custom converter class to deserialize the abstract class SquaddingAssignment into one of its Concrete classes. Typeically can rely on the standard JsonConverter that looks at the $type variable to know what Concrete class to deserialize to. However, the value from $type is specific to a Media class, and not BabelFish, so the values don't match. Thus, we need to write our own converter. Recipe comes from https://stackoverflow.com/questions/20995865/deserializing-json-to-abstract-class

Definition

Namespace: Scopos.BabelFish.Converters.Newtonsoft
Assembly: BabelFish (in BabelFish.dll) Version: 1.11.1.4+b1da393815f6638555a663d9a94167ecabea5695
C#
public class ScoreHistoryBaseConverter : JsonConverter
Inheritance
Object    JsonConverter    ScoreHistoryBaseConverter

Constructors

Properties

CanRead Gets a value indicating whether this JsonConverter can read JSON.
(Inherited from JsonConverter)
CanWrite
(Overrides JsonConverter.CanWrite)

Methods

CanConvert
(Overrides JsonConverter.CanConvert(Type))
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ReadJson
(Overrides JsonConverter.ReadJson(JsonReader, Type, Object, JsonSerializer))
ToStringReturns a string that represents the current object.
(Inherited from Object)
WriteJson
(Overrides JsonConverter.WriteJson(JsonWriter, Object, JsonSerializer))

See Also