I have a data entity with the property 'UserType' returned as an Enum and need to convert it to another.
The first enum is (with numbers based on values from the database):
public enum UserType
{
Primary = 100001,
Secondary = 100002,
Other = 100003
}
And this is what I want to convert it to:
public enum UserType
{
Primary,
Secondary,
Other
}
This is in order to set the UserType on this class:
public class UserData
{
public UserType UserType{ get; set; }
}
Something like the following maybe?
MemberType = MemberType(entity.MemberType.ReadValue())
Does anyone know the best way to do this please?