In my database I'm saving numbers. Each number has been allocated to a day. For example 1 equals Monday.
In my C# code I have an enum like:
enum day { Sunday=0, Monday, Tuesday, Wednesday, Thursday, Friday,Saturday };
I want get current day from host and compare it with my database, for checking user access.
What is the best way to compare an enum value with a generic List<int>
?
I took a look at this topic How to compare enum and int values? but it wasn't useful for me.
UPDATE:
I have user access in my program by day and time. I saved the days which can have access to app. the days had saved as integer; so when user wanna login I have to compare integer with enum. because I fetch from database one time, so I have List<int>
of days.
I dont know is there any better way to do it or not?!