Пример #1
0
 /// <summary>
 /// Adds an OR condition to the select statement.
 /// </summary>
 /// <param name="select">The select statement.</param>
 /// <param name="column">The column.</param>
 /// <param name="op">The op.</param>
 /// <param name="value">The value.</param>
 /// <returns>The select statement.</returns>
 public static SelectStatement Or(this SelectStatement select, SourceExpression column, SqlOperator op, object value)
 {
     select.Conditions.Add(new Condition(column, op, value)
     {
         Relationship = ConditionRelationship.Or
     });
     return(select);
 }
Пример #2
0
 /// <summary>
 /// Adds a NOT condition to the select statement.
 /// </summary>
 /// <param name="select">The select statement.</param>
 /// <param name="column">The column.</param>
 /// <param name="op">The op.</param>
 /// <param name="value">The value.</param>
 /// <returns>The select statement.</returns>
 public static SelectStatement WhereNot(this SelectStatement select, SourceExpression column, SqlOperator op, object value)
 {
     select.Conditions.Add(new Condition(column, op, value)
     {
         Not = true
     });
     return(select);
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BinaryOperation" /> class.
 /// </summary>
 /// <param name="left">The expression on the left of the operator.</param>
 /// <param name="op">The operator.</param>
 /// <param name="right">The expression on the right of the operator.</param>
 public BinaryOperation(SourceExpression left, BinaryOperator op, SourceExpression right)
 {
     this.Left     = left;
     this.Operator = op;
     this.Right    = right;
 }
 public Condition(SourceExpression column, SqlOperator op, object value)
 {
     this.Field    = column;
     this.Operator = op;
     AddValue(value);
 }
Пример #5
0
 public Join(JoinType joinType, Table table, SourceExpression leftColumn, SourceExpression rightColumn)
 {
     this.JoinType = joinType;
     this.Table    = table;
     this.Conditions.Add(new Condition(leftColumn, SqlOperator.Equals, rightColumn));
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderByExpression" /> class.
 /// </summary>
 /// <param name="expression">The expression that is ordered by.</param>
 /// <param name="direction">The direction of ordering.</param>
 public OrderByExpression(SourceExpression expression, OrderDirection direction)
 {
     this.Expression = expression;
     this.Direction  = direction;
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderByExpression" /> class.
 /// </summary>
 /// <param name="expression">The expression that is ordered by.</param>
 public OrderByExpression(SourceExpression expression)
 {
     this.Expression = expression;
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConvertFunction" /> class.
 /// </summary>
 /// <param name="expression">The expression to convert.</param>
 public ConvertFunction(SourceExpression expression)
 {
     this.Expression = expression;
 }