示例#1
0
        /// <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);
        }
示例#2
0
        /// <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);
        }
示例#3
0
 /// <summary>
 /// Creates a Decrement expression over the given one.
 /// </summary>
 public static FluentExpression Decrement <T>(Expression <Func <T> > expression)
 {
     return(FluentExpression.Create(expression).Decrement());
 }
示例#4
0
 /// <summary>
 /// Adds a LessThanOrEqual comparison to this expression.
 /// </summary>
 public FluentExpression LessThanOrEqual(FluentExpression expression)
 {
     Expression = Expression.LessThanOrEqual(Expression, expression);
     return(this);
 }
示例#5
0
 /// <summary>
 /// Adds a GreaterThanOrEqual comparison to this expression.
 /// </summary>
 public FluentExpression GreaterThanOrEqual(FluentExpression expression)
 {
     Expression = Expression.GreaterThanOrEqual(Expression, expression);
     return(this);
 }
示例#6
0
 /// <summary>
 /// Adds a Different comparison to this expression.
 /// </summary>
 public FluentExpression NotEqual(FluentExpression expression)
 {
     Expression = Expression.NotEqual(Expression, expression);
     return(this);
 }
示例#7
0
 /// <summary>
 /// Adds an arithmatic Divide to this expression.
 /// </summary>
 public FluentExpression Divide(FluentExpression expression)
 {
     Expression = Expression.Divide(Expression, expression);
     return(this);
 }
示例#8
0
 /// <summary>
 /// Adds an arithmatic Multiply to this expression.
 /// </summary>
 public FluentExpression Multiply(FluentExpression expression)
 {
     Expression = Expression.Multiply(Expression, expression);
     return(this);
 }
示例#9
0
 /// <summary>
 /// Adds an arithmatic Subtract to this expression.
 /// </summary>
 public FluentExpression Subtract(FluentExpression expression)
 {
     Expression = Expression.Subtract(Expression, expression);
     return(this);
 }
示例#10
0
 /// <summary>
 /// Adds an arithmatic Add to this expression.
 /// </summary>
 public FluentExpression Add(FluentExpression expression)
 {
     Expression = Expression.Add(Expression, expression);
     return(this);
 }
示例#11
0
 /// <summary>
 /// Adds a conditional (boolean) or to this expression.
 /// </summary>
 public FluentExpression ConditionalOr(FluentExpression expression)
 {
     Expression = Expression.OrElse(Expression, expression);
     return(this);
 }
示例#12
0
 /// <summary>
 /// Adds a condition (boolean) and to this expression.
 /// </summary>
 public FluentExpression ConditionalAnd(FluentExpression expression)
 {
     Expression = Expression.AndAlso(Expression, expression);
     return(this);
 }
示例#13
0
 /// <summary>
 /// Adds a bitwise xor to this expression.
 /// </summary>
 public FluentExpression BitwiseXor(FluentExpression expression)
 {
     Expression = Expression.ExclusiveOr(Expression, expression);
     return(this);
 }
示例#14
0
 /// <summary>
 /// Adds a bitwise or to this expression.
 /// </summary>
 public FluentExpression BitwiseOr(FluentExpression expression)
 {
     Expression = Expression.Or(Expression, expression);
     return(this);
 }
示例#15
0
 /// <summary>
 /// Adds a bitwise and to this expression.
 /// </summary>
 public FluentExpression BitwiseAnd(FluentExpression expression)
 {
     Expression = Expression.And(Expression, expression);
     return(this);
 }
示例#16
0
 /// <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());
 }