Ejemplo n.º 1
0
        private PropertyUnit <TSource> UnitAddOp(PropertyUnit <TSource> unit)
        {
            var operand = unit.Exp;

            if (PropertyType == typeof(string))
            {
                return(new PropertyUnit <TSource>(Parameter, Expression.Add(Exp, operand, MethodUnit.StringConcat), typeof(string)));
            }
            else
            {
                return(new PropertyUnit <TSource>(Parameter, Expression.AddChecked(Exp, operand), PropertyType));
            }
        }
Ejemplo n.º 2
0
        private WhereExp <TSource> CompareOp(Func <Expression, Expression, BinaryExpression> func, PropertyUnit <TSource> unit)
        {
            var operand = unit.Exp;
            var body    = func(Exp, operand);
            var exp     = Expression.Lambda <Func <TSource, bool> >(body, Parameter);

            return(new WhereExp <TSource>(exp));
        }
Ejemplo n.º 3
0
        private PropertyUnit <TSource> UnitOp(Func <Expression, Expression, BinaryExpression> func, PropertyUnit <TSource> unit)
        {
            var operand = unit.Exp;

            return(new PropertyUnit <TSource>(Parameter, func(Exp, operand), PropertyType));
        }