예제 #1
0
 public override void Visit(SqlSubquery expression)
 {
     // TODO: This is weird and should actually be handled in SqlSubquery.Accept().
     _writer.WriteOpenParenthesis();
     expression.Query.Accept(this);
     _writer.WriteCloseParenthesis();
     if (expression.Alias != null)
     {
         _writer.WriteIdentifier(expression.Alias);
     }
 }
예제 #2
0
 public FromClause(SqlSelect parent, SqlSubquery query)
     : base(parent)
 {
     if (query == null)
     {
         throw new ArgumentNullException(nameof(query));
     }
     if (query.Alias == null)
     {
         throw new ArgumentException("An alias is required for subqueries in a FROM clause.", nameof(query));
     }
     Parent.From = new SqlFrom(query);
 }
예제 #3
0
 public ISqlSelectFromClause From(SqlSubquery query)
 {
     return(new FromClause(Parent, query));
 }
예제 #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);
 }
예제 #5
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));
 }