I have a [Flags] enum like this:
[Flags]
public enum Status
{
None = 0,
Active = 1,
Inactive = 2,
Unknown = 4
}
A Status enum may c
I am unsure if a bitwise AND-operation will work, but try casting s to an int:
int i = (int)s;
var result = from r in db.Records
select r
where (r.Status & i) == r.Status
Which database engine are you using? Possibly the engine does not support bitwise operations.
Reference: http://www.matthidinger.com/archive/2008/02/26/entity-framework-comparison-frustration-explained.aspx
var result = from r in db.Records
where r.Status == s
select r