I\'m consuming an api which returns string values like this. some-enum-value
I try to put these values in an enum, since the default StringEnumConverter
You can also use this code:
[JsonConverter(typeof(StringEnumConverter))]
public enum ResposeStatus
{
[EnumMember(Value = "success value")]
Success,
[EnumMember(Value = "fail value")]
Fail,
[EnumMember(Value = "error value")]
Error
};
When serializing JsonConvert.Serialize(), will use the text inside the EnumMember.