<p>I have a table of Users that includes a bitmask of roles that the user belongs to. I'd like to select users that belong to one or more of the roles in a bitmask value. For example:</p>

<pre>select *
from   [User]
where  UserRolesBitmask | 22 = 22</pre>

<p>This selects all users that have the roles '2', '4' or '16' in their bitmask. Is this possible to express this in a LINQ query? Thanks.</p>

I think this will work, but I haven't tested it.Substitute the name of your DataContext object. YMMV.
```
```
from u in DataContext.Users
where UserRolesBitmask | 22 == 22
select u
```
```