0

I am using enum for dayofweek. We go to asp builder and model page,to apply jsond property,default values,and jsonconverter. Here what do i apply for jsonconverter(typeof(..?)) But we are using string type in enum values we are used stringenumconverter. please reply.

public enum dayofweek{
sunday = 0,
monday = 1,
.
.
saturday = 6
}
HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
sakhi
  • 9

1 Answers1

1

I think you are looking for

 [JsonConverter(typeof(StringEnumConverter))]

checkout more info on other so answer JSON serialization of enum as string

Community
  • 1
  • 1
Alan Tsai
  • 2,465
  • 1
  • 13
  • 16