Ok, for example, I use bitwise: Monday = 1, Tuesday = 2, Wednesday = 4, Thursday = 8, etc.
I am using the Entity Framework class for Business.
I use a class and pass a value like 7 (Monday, Tuesday, Wednesday).
I want to return records matching any of these days
public List<Business> GetBusinesses(long daysOfWeek) { using (var c = Context()) { return c.Businesses.Where(???).ToList(); } }
Any help would be greatly appreciated. Thanks!
EDIT
So, I am trying to do the following:
var b = new List<Business>(); var b1 = new Business(){DaysOfWeek = 3}; b.Add(b1); var b2 = new Business() { DaysOfWeek = 2 }; b.Add(b2); var decomposedList = new[]{1}; var l = b.Where(o => decomposedList.Any(day => day == o.DaysOfWeek)).ToList();
But l returns 0 results accepted in decposedList (1) I'm looking for monday. I created b1 to contain Monday and Tuesday.
source share