Represents a subquery to test for existence of rows.
Inheritance: DbExpression
コード例 #1
0
 /// <summary>
 /// Translates the <paramref name="existsExpression"/> into a string representation.
 /// </summary>
 /// <param name="existsExpression">The <see cref="DbExistsExpression"/> to translate.</param>
 /// <returns><see cref="string"/></returns>
 protected override DbExpression VisitExistsExpression(DbExistsExpression existsExpression)
 {
     var syntax = string.Format("EXISTS{0}", Visit(existsExpression.SubSelectExpression));
     return ExpressionFactory.Sql(syntax);
 }
コード例 #2
0
        /// <summary>
        /// Translates the <paramref name="existsExpression"/> into a string representation.
        /// </summary>
        /// <param name="existsExpression">The <see cref="DbExistsExpression"/> to translate.</param>
        /// <returns><see cref="string"/></returns>
        protected override DbExpression VisitExistsExpression(DbExistsExpression existsExpression)
        {
            var syntax = string.Format("EXISTS{0}", Visit(existsExpression.SubSelectExpression));

            return(ExpressionFactory.Sql(syntax));
        }
コード例 #3
0
 /// <summary>
 /// Translates the <paramref name="existsExpression"/> into a string representation.
 /// </summary>
 /// <param name="existsExpression">The <see cref="DbExistsExpression"/> to translate.</param>
 /// <returns><see cref="DbExpression"/></returns>
 protected virtual DbExpression VisitExistsExpression(DbExistsExpression existsExpression)
 {
     var subSelectExpression = Visit(existsExpression.SubSelectExpression);
     if (!ReferenceEquals(existsExpression.SubSelectExpression, subSelectExpression))
         return ExpressionFactory.Exists((DbQuery<DbSelectExpression>)subSelectExpression);
     return existsExpression;
 }