I have enum:
public enum Days
{
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
Sunday = 7
}
I use this enum to insert value as int as ID into database. But how can I "map" enum Days
with that database IDs while I am retrieving value from database to show name of days instead of that database ID in my view?
For example I have a list of data shown, and currently I have DayId and ID shown, but how can I map this ID to show enum text (Monday, Tuesday,...) instead of ID(1,2,3..) ?