/// <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); }
/// <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); }
/// <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>())); }
/// <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); }
public ISqlGroupByClause GroupBy(SqlColumn column) { return(new GroupByClause(Parent, column)); }
public ISqlThenByClause <SqlSelect> OrderBy(SqlColumn column, SqlSortOrder sortOrder) { return(new OrderByClause(Parent, column, sortOrder)); }
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; }