/// <summary> /// Creates a new fluent expression based on an already existing expression. /// </summary> public static FluentExpression Create <T>(Expression <Func <T> > expression) { var result = new FluentExpression(); if (expression != null) { result.Expression = expression.Body; } return(result); }
/// <summary> /// Creates a new fluent expression based on an already existing expression. /// </summary> public static FluentExpression Create(Expression expression) { var result = new FluentExpression(); if (expression != null) { if (expression.NodeType != ExpressionType.Lambda) { result.Expression = expression; } else { LambdaExpression lamdaExpression = (LambdaExpression)expression; result.Expression = lamdaExpression.Body; } } return(result); }
/// <summary> /// Creates a Decrement expression over the given one. /// </summary> public static FluentExpression Decrement <T>(Expression <Func <T> > expression) { return(FluentExpression.Create(expression).Decrement()); }
/// <summary> /// Adds a LessThanOrEqual comparison to this expression. /// </summary> public FluentExpression LessThanOrEqual(FluentExpression expression) { Expression = Expression.LessThanOrEqual(Expression, expression); return(this); }
/// <summary> /// Adds a GreaterThanOrEqual comparison to this expression. /// </summary> public FluentExpression GreaterThanOrEqual(FluentExpression expression) { Expression = Expression.GreaterThanOrEqual(Expression, expression); return(this); }
/// <summary> /// Adds a Different comparison to this expression. /// </summary> public FluentExpression NotEqual(FluentExpression expression) { Expression = Expression.NotEqual(Expression, expression); return(this); }
/// <summary> /// Adds an arithmatic Divide to this expression. /// </summary> public FluentExpression Divide(FluentExpression expression) { Expression = Expression.Divide(Expression, expression); return(this); }
/// <summary> /// Adds an arithmatic Multiply to this expression. /// </summary> public FluentExpression Multiply(FluentExpression expression) { Expression = Expression.Multiply(Expression, expression); return(this); }
/// <summary> /// Adds an arithmatic Subtract to this expression. /// </summary> public FluentExpression Subtract(FluentExpression expression) { Expression = Expression.Subtract(Expression, expression); return(this); }
/// <summary> /// Adds an arithmatic Add to this expression. /// </summary> public FluentExpression Add(FluentExpression expression) { Expression = Expression.Add(Expression, expression); return(this); }
/// <summary> /// Adds a conditional (boolean) or to this expression. /// </summary> public FluentExpression ConditionalOr(FluentExpression expression) { Expression = Expression.OrElse(Expression, expression); return(this); }
/// <summary> /// Adds a condition (boolean) and to this expression. /// </summary> public FluentExpression ConditionalAnd(FluentExpression expression) { Expression = Expression.AndAlso(Expression, expression); return(this); }
/// <summary> /// Adds a bitwise xor to this expression. /// </summary> public FluentExpression BitwiseXor(FluentExpression expression) { Expression = Expression.ExclusiveOr(Expression, expression); return(this); }
/// <summary> /// Adds a bitwise or to this expression. /// </summary> public FluentExpression BitwiseOr(FluentExpression expression) { Expression = Expression.Or(Expression, expression); return(this); }
/// <summary> /// Adds a bitwise and to this expression. /// </summary> public FluentExpression BitwiseAnd(FluentExpression expression) { Expression = Expression.And(Expression, expression); return(this); }
/// <summary> /// Creates a new expression that "negates" the given one. /// </summary> public static FluentExpression Negate <T>(Expression <Func <T> > expression) { return(FluentExpression.Create(expression).Negate()); }