I want to deserialize enums into their string representation and vice versa using json.net. The only way I can define a structure to apply its StringEnumConverter is to annotate the given properties as follows:
[JsonConverter(typeof(StringEnumConverter))] public virtual MyEnums MyEnum { get; set; }
However, in my case it would be much more convenient to configure json.net all over the world so that all enumerations get (de) serialized using StringEnumConverter without the need for additional annotations.
Is there any way to do this, for example. using custom JsonSerializerSettings ?
Leo Sep 15 '11 at 8:25 2011-09-15 08:25
source share