For Babelfish Release 1.11.1.3

EnumConverterByDescriptionT Class

Json converter for Enums. Uses an enum's Description first, if defined, else the enum string value.

Definition

Namespace: Scopos.BabelFish.Converters.Microsoft
Assembly: BabelFish (in BabelFish.dll) Version: 1.11.1.4+b1da393815f6638555a663d9a94167ecabea5695
C#
public class EnumConverterByDescription<T> : JsonConverter<T>
where T : Enum
Inheritance
Object    JsonConverter    JsonConverterT    EnumConverterByDescriptionT

Type Parameters

T

Remarks

As a general rule, enums properties should be decorated with the following JsonProperty to always wrtie their value when JSON is serialized. [G_NS.JsonProperty( DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Include )]

Constructors

Properties

HandleNullGets a value that indicates whether should be passed to the converter on serialization, and whether Null should be passed on deserialization.
(Inherited from JsonConverterT)
TypeGets the type being converted by the current converter instance.
(Inherited from JsonConverterT)

Methods

CanConvertDetermines whether the specified type can be converted.
(Inherited from JsonConverterT)
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)
ReadReads and converts the JSON to type T.
(Overrides JsonConverterTRead(Utf8JsonReader, Type, JsonSerializerOptions))
ReadAsPropertyNameReads a dictionary key from a JSON property name.
(Inherited from JsonConverterT)
ToStringReturns a string that represents the current object.
(Inherited from Object)
WriteWrites a specified value as JSON.
(Overrides JsonConverterTWrite(Utf8JsonWriter, T, JsonSerializerOptions))
WriteAsPropertyNameWrites a dictionary key as a JSON property name.
(Inherited from JsonConverterT)

Fields

See Also