Tom Kerkhove Tom Kerkhove - 1 year ago 96
C# Question

Custom names to enumeration values

I have an enumeration of values that come through an API.

Those names are good but there is one I want to change with data annotations but how do you do that?

My enumeration looks like :

public enum TopicType
All = 0,

I want to change the "ToDo" to "ToDoItem" when I'm coding but I can't change the value in the enumeration due to serialization of my enum-object so I'll have to use data annotations, any suggestions?

Answer Source

I think You can try over [Display()] Annotation.

I hope this what you are expecting..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download