I was not sure what your reply meant since it did not compile and does not have any instructions on what you had intended. Your reply is not an example of how to perform the bitwise operation using mathematical operators. Instead, you proposed an extension method to a Lambda expression which can then use the standard .NET bitwise operator.
To let other users see how OpenAccess can perform a bitwise compare, here is the fragments that need to be created. First, you need an extension method on the type that you want to do a bitwise operation on. Then, use the extension method in the lambda expression.
static class LinqExtensionMethods
public static bool IsBitSet(this LC.Global.PatientAge fieldvalue, int bitmask)
if (((int) fieldvalue & bitmask) == bitmask) return true;
else return false;
// use the method above in a standard old lambda expression
var templ = context.orm.Templates.Where(t => t.AgeFilterId.IsBitSet (4));
Hope this helps someone else.