You can achieve it but will required bit of work.
- Define an attribute class which will contain the string value for enum.
- Define an extension method which will return back the value from the attribute. Eg..GetStringValue(this Enum value) will return attribute value.
- Then you can define the enum like this..
public enum Test : int {
[StringValue("a")]
Foo = 1,
[StringValue("b")]
Something = 2
}
- To get back the value from Attrinbute Test.Foo.GetStringValue();
Refer : Enum With String Values In C#