I have an enum definition like this:
public enum columnName
{
Name
Age
DOB
}
I would like to create a class with properties' names equals to enum values; i.e.:
public class Person
{
public string Name {get;set;}
public string Age {get;set;}
public string DOB {get;set;}
}
Instead of having static properties' names like in the class above, is there any possibility to refer to them via the enum values? I'm talking about something like:
public class Person
{
public string columnName.Name.toString() {get;set;}
public string columnName.Age.toString() {get;set;}
public string columnName.DOB.toString() {get;set;}
}