I have a user table that includes the bitmask of the roles the user belongs to. I would like to select users belonging to one or more roles in the bitmask. For instance:
select *
from [User]
where UserRolesBitmask | 22 = 22
This selects all users who have the roles "2", "4" or "16" in their bitmask. Can this be expressed in a LINQ query? Thanks.
Nick source share