Exemplo n.º 1
0
 private Rule(OperationCode op, Expression left, Expression right, ParameterExpression pe, ClauseCode cl)
 {
     LeftExp     = left;
     RightExp    = right;
     CombinedExp = left.Operate(right, op);
     ParamExp    = pe;
     Clause      = cl;
 }
Exemplo n.º 2
0
        internal Rule(OperationCode op, Tuple <string, Type> keyValue, string property, ClauseCode clause)
        {
            Operator      = op;
            TypeValuePair = (keyValue.Item1, keyValue.Item2);
            Property      = property;
            Clause        = clause;
            ParamExp      = Expression.Parameter(typeof(T), "x");
            var typeValue = Convert.ChangeType(TypeValuePair.Item1, TypeValuePair.Item2);

            RightExp    = Expression.Constant(typeValue);
            LeftExp     = Left(ParamExp, property);
            CombinedExp = Combined(LeftExp, RightExp);
        }