|
|
Hello,
I have an Enum defined something like
public MyEnum{
ONE,
TWO,
}
I'm trying to get Enums to serialize as "ONE", "TWO", not "0", "1".
I have tried:
JsonSerializerSettings settings = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore };
settings.Converters.Add(new StringEnumConverter());
var data = JsonConvert.SerializeObject(item, Formatting.Indented, settings);
but this does not seem to work. I think the issue is I'm using [DataMember] on my properties.
Is it expected behavior to ignore the StringEnumConverter on properties decorated with [DataMember]?
Thanks in advance,
Jon
|
|
|
|
i am struggling the same. I got the reply with "read the documentation".
I can read object browser output but to find the way to solve our problem by reading the object browser-output is not my way to go...
So I am stuck too...
|
|