In my class, I have an enum definition as followed:
public enum ChangeType {
[EnumMember(Value ="Added")]
Added,
[EnumMember(Value = "Removed")]
Removed,
[EnumMember(Value = "Updated")]
Updated
}
And in the class definition, I have a property:
public
Dictionary<string, (ChangeType changType, string oldValue, string newValue)>
PropertyChanges { get; set; }
Requirements:
- When converting to JSON, changeType should be in text, not number
- Tuple should be converted w/ the name of the items instead of Item1, Item2 and Item3
What I have tried:
- As for the enum, I tried putting the JsonConverter(typeof(StringEnumConverter))] in front of the property (no go)
- Cannot any recommendation about the named tuples
Question:
Can I achieve the above without writing a custom converter to convert the whole class?
Thanks!