I'm making a SP2010 page where user can filter items by their phase (It's a multichoice field). For performance reasons and the nature of the filters I had to resort to System.Linq.Dynamic to make this query.
I've tried the following (this is not real code but exemplifies what I'm doing):
var lstObjects = new List<object>();
var query = "Phase = @0 ";
lstObjects.Add(Phase.Value);
context.myList.Where(query,lstObjects.ToArray());
This works if the item has only one phase and is the one being filtered. If the item has multiple phases (like Phase 1 and 2) and I filter by Phase 1, it must show. How can I filter the multichoice fields?
EDIT: Forgot to mention, the type of the object "Phase.Value" is a flag enum that was generated using SPMetal.