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)); } }
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)); }
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)); }