I have enum defined as below
public enum PatientRaceCodeType
{
[StringValue("Question not asked")]
Q = 8,
[StringValue("Unknown")]
U = Q | B,
[StringValue("Native Hawaiian OR Other Pacific Islander")]
P = Q | D,
}
I need to get the string value for example if U
it should return "unknown"
tried this:
Enum.GetName(typeof(testRaceCodeType), test.RaceCode)
which is not working. test.Racecode
has value U