Ejemplo n.º 1
0
 /// <summary>
 /// Creates a <see cref="SqlBinaryExpression"/> that represents an equality comparison.
 /// </summary>
 /// <param name="column">
 /// A <see cref="SqlColumn"/> to use as the left operand in the expression.
 /// </param>
 /// <param name="value">
 /// A <see cref="SqlValue"/> to use as the right operand in the expression.
 /// </param>
 /// <returns>
 /// A <see cref="SqlBinaryExpression"/> that represents an equality comparison between
 /// the value of the specified <paramref name="column"/> and the specified <paramref name="value"/>.
 /// </returns>
 /// <remarks>
 /// If you pass <see langword="null"/> for the <paramref name="value"/> argument, it
 /// will be automatically converted to <see cref="SqlConstant.Null"/>.
 /// </remarks>
 public static SqlBinaryExpression Equal(SqlColumn column, SqlValue value)
 {
     return new SqlBinaryExpression(column, SqlBinaryOperator.Equal, value ?? SqlConstant.Null);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a <see cref="SqlBinaryExpression"/> that represents an "greater than" comparison.
 /// </summary>
 /// <param name="column">
 /// A <see cref="SqlColumn"/> to use as the left operand in the expression.
 /// </param>
 /// <param name="value">
 /// A <see cref="SqlValue"/> to use as the right operand in the expression.
 /// </param>
 /// <returns>
 /// A <see cref="SqlBinaryExpression"/> that represents an "greater than" comparison between
 /// the value of the specified <paramref name="column"/> and the specified <paramref name="value"/>.
 /// </returns>
 /// <remarks>
 /// If you pass <see langword="null"/> for the <paramref name="value"/> argument, it
 /// will be automatically converted to <see cref="SqlConstant.Null"/>.
 /// </remarks>
 public static SqlBinaryExpression GreaterThan(SqlColumn column, SqlValue value)
 {
     return new SqlBinaryExpression(column, SqlBinaryOperator.GreaterThan, value ?? SqlConstant.Null);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a <see cref="SqlBinaryExpression"/> that represents an "in" comparison.
 /// </summary>
 /// <param name="column">
 /// A <see cref="SqlColumn"/> to use as the left operand in the expression.
 /// </param>
 /// <param name="values">
 /// A collection of <see cref="SqlValue"/> to use as the right operand in the expression.
 /// </param>
 /// <returns>
 /// A <see cref="SqlBinaryExpression"/> that represents an "in" comparison between
 /// the value of the specified <paramref name="column"/> and the specified collection of
 /// <paramref name="values"/>.
 /// </returns>
 /// <remarks>
 /// If you pass <see langword="null"/> for the <paramref name="values"/> argument, it
 /// will be automatically converted to an empty collection.
 /// </remarks>
 public static SqlBinaryExpression In(SqlColumn column, params SqlValue[] values)
 {
     return new SqlBinaryExpression(column, SqlBinaryOperator.In, new SqlValueList(values ?? Enumerable.Empty<SqlValue>()));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a <see cref="SqlBinaryExpression"/> that represents an "in" comparison.
 /// </summary>
 /// <param name="column">
 /// A <see cref="SqlColumn"/> to use as the left operand in the expression.
 /// </param>
 /// <param name="query">
 /// A <see cref="SqlSubquery"/> to use as the right operand in the expression.
 /// </param>
 /// <returns>
 /// A <see cref="SqlBinaryExpression"/> that represents an "in" comparison between
 /// the value of the specified <paramref name="column"/> and the specified <paramref name="query"/>.
 /// </returns>
 public static SqlBinaryExpression In(SqlColumn column, SqlSubquery query)
 {
     return new SqlBinaryExpression(column, SqlBinaryOperator.In, query);
 }
Ejemplo n.º 5
0
 public ISqlGroupByClause GroupBy(SqlColumn column)
 {
     return(new GroupByClause(Parent, column));
 }
Ejemplo n.º 6
0
 public ISqlThenByClause <SqlSelect> OrderBy(SqlColumn column, SqlSortOrder sortOrder)
 {
     return(new OrderByClause(Parent, column, sortOrder));
 }
Ejemplo n.º 7
0
 internal SqlAssign(SqlColumn column, SqlValue value)
 {
     if (column == null) throw new ArgumentNullException(nameof(column));
     Column = column;
     Value = value ?? SqlConstant.Null;
 }
 public ISqlSetClause Set(SqlColumn column, SqlValue value)
 {
     return(new SetClause(Parent, column, value));
 }
 protected override SqlExpression VisitColumn(SqlColumn expression)
 {
     _writer.WriteColumn(expression.TableName, expression.ColumnName, expression.Alias);
     return expression;
 }