Two tables (MainTable and EventType). EventType is represented in code as an enumeration and is foreign keyed in the database so that it looks like;
Public enum EventTypeId As Integer
Blah = 1
Blurgh = 2
Whoo = 3
End Enum
I can run the following query fine;
From M in dbx.MainTable Where M.EventType.EventTypeId = 1
But I can't do this (psuedo code);
From M in dbx.MainTable Where M.EventType.EventTypeId.Contains(EventTypeId.Blah,EventTypeId.Whoo)
The 2nd approach is more readable and maintainable as it links to the enum, but I can't find a construct in EF that allows me to do this.
This is the current version of EF, not .Net 4.0.
In summary, what I want to do in SQL is easy, it just needs to be in EF;
Select * From MainTable Where EventTypeId In (1,3);