public enum TimeFormat
{ 
        @12-hour,
        @24-hour
}
Hi,
I use newtonsoft deserializer for deserialize json string to an object.
JsonDeserializer checks enum parameter name. if it's same with json string. it converts string to enum.
Can I use Dash,Minus (-) character in an enum as enum parameter. I tried to use as above, But I couldn't compile project.
Then I tried this.
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum TimeFormat
{
    [JsonProperty("12-hour")]
    hour12,
    [JsonProperty("24-hour")]
    hour24,
}
Deserializer couldn't deserialize json string.
Error : Requested value '12-hour' was not foun
 
    