I would like to know more about enums in C#. is it best practice to use enum for creating custom variables? or we can use some another better approach for below example. How we can access it and store enum values to an array of integer using foreach or for loop or any other method.
enum timeSlots
{
AM9h = 0,
AM10h = 1,
AM11h = 2,
AM12h = 3,
PM1h = 4,
PM2h = 5,
PM3h = 6,
PM4h = 7,
PM5h = 8,
PM6h = 9,
}
how can I store timeslots enum's value to an int array?