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
}

1 Answer 1

1

I think you are looking for

 [JsonConverter(typeof(StringEnumConverter))]

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.