I'm trying to create this where clause in SQL Server...
WHERE bitValue & 10 > 0
This will give me any row, that has a bitvalue that mashes with 10 ( 2 or 8 ) -- Simple enough. Now writing the predicate, I'm stuck. I'm sure it's something minor I'm over looking. The documentation builds this example. Which uses IExpression(s), but not BitwiseAnd
// C#
IExpression leftOperand = new Expression(MyEntityFields.Field1, ExOp.Add, MyEntityFields.Field2);
IExpression rightOperand = new Expression(
MyEntityFields.Field3, ExOp.Mul, MyEntityFields.Field4);
IEntityField2 field = MyEntityFields.Field1.SetExpression(leftOperand);
IPredicate filter = FieldCompareExpressionPredicate(field, null, ExOp.GreaterThan, rightOperand);
// which is equal to:
IPredicate filter = ((MyEntityFields.Field1 + MyEntityFields.Field2) >
MyEntityFields.Field3 * MyEntityFields.Field4));
In a dream world, I could use this.
FieldCompareValuePredicate( WhateverFields.BitValue, null, ExOp.BitwiseAnd, 10 );
But FieldCompareValuePredicate isn't compatible with ExOp because the Bit Operators are SQLServer Only.
I can't seem to get anything to work.
I guess the short(er) version is that I'm looking for a predicate example that uses ExOp.BitwiseAnd
Thanks for the help.