DbRawSqlQuery<TElement> DbRawSqlQuery<TElement> DbRawSqlQuery<TElement> Class

Definition

Represents a SQL query for non-entities that is created from a DbContext and is executed using the connection from that context. Instances of this class are obtained from the Database instance. The query is not executed when this object is created; it is executed each time it is enumerated, for example by using foreach. SQL queries for entities are created using SqlQuery(String, Object[]). See DbRawSqlQuery for a non-generic version of this class.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
public class DbRawSqlQuery<TElement> : System.Collections.Generic.IEnumerable<TElement>, System.ComponentModel.IListSource, System.Data.Entity.Infrastructure.IDbAsyncEnumerable<TElement>
type DbRawSqlQuery<'Element> = class
    interface seq<'Element>
    interface IEnumerable
    interface IListSource
    interface IDbAsyncEnumerable<'Element>
    interface IDbAsyncEnumerable
Public Class DbRawSqlQuery(Of TElement)
Implements IDbAsyncEnumerable(Of TElement), IEnumerable(Of TElement), IListSource

Type Parameters

TElement

The type of elements returned by the query.

Inheritance
DbRawSqlQuery<TElement>DbRawSqlQuery<TElement>DbRawSqlQuery<TElement>
Attributes
Implements

Methods

AllAsync(Func<TElement,Boolean>) AllAsync(Func<TElement,Boolean>) AllAsync(Func<TElement,Boolean>)

Asynchronously determines whether all the elements of the query satisfy a condition.

AllAsync(Func<TElement,Boolean>, CancellationToken) AllAsync(Func<TElement,Boolean>, CancellationToken) AllAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously determines whether all the elements of the query satisfy a condition.

AnyAsync() AnyAsync() AnyAsync()

Asynchronously determines whether the query contains any elements.

AnyAsync(Func<TElement,Boolean>) AnyAsync(Func<TElement,Boolean>) AnyAsync(Func<TElement,Boolean>)

Asynchronously determines whether any element of the query satisfies a condition.

AnyAsync(CancellationToken) AnyAsync(CancellationToken) AnyAsync(CancellationToken)

Asynchronously determines whether the query contains any elements.

AnyAsync(Func<TElement,Boolean>, CancellationToken) AnyAsync(Func<TElement,Boolean>, CancellationToken) AnyAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously determines whether any element of the query satisfies a condition.

AsStreaming() AsStreaming() AsStreaming()

Returns a new query that will stream the results instead of buffering.

ContainsAsync(TElement) ContainsAsync(TElement) ContainsAsync(TElement)

Asynchronously determines whether the query contains a specified element by using the default equality comparer.

ContainsAsync(TElement, CancellationToken) ContainsAsync(TElement, CancellationToken) ContainsAsync(TElement, CancellationToken)

Asynchronously determines whether the query contains a specified element by using the default equality comparer.

CountAsync() CountAsync() CountAsync()

Asynchronously returns the number of elements in the query.

CountAsync(Func<TElement,Boolean>) CountAsync(Func<TElement,Boolean>) CountAsync(Func<TElement,Boolean>)

Asynchronously returns the number of elements in the query that satisfy a condition.

CountAsync(CancellationToken) CountAsync(CancellationToken) CountAsync(CancellationToken)

Asynchronously returns the number of elements in the query.

CountAsync(Func<TElement,Boolean>, CancellationToken) CountAsync(Func<TElement,Boolean>, CancellationToken) CountAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously returns the number of elements in the query that satisfy a condition.

Equals(Object) Equals(Object) Equals(Object)
FirstAsync() FirstAsync() FirstAsync()

Asynchronously returns the first element of the query.

FirstAsync(Func<TElement,Boolean>) FirstAsync(Func<TElement,Boolean>) FirstAsync(Func<TElement,Boolean>)

Asynchronously returns the first element of the query that satisfies a specified condition.

FirstAsync(CancellationToken) FirstAsync(CancellationToken) FirstAsync(CancellationToken)

Asynchronously returns the first element of the query.

FirstAsync(Func<TElement,Boolean>, CancellationToken) FirstAsync(Func<TElement,Boolean>, CancellationToken) FirstAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously returns the first element of the query that satisfies a specified condition.

FirstOrDefaultAsync() FirstOrDefaultAsync() FirstOrDefaultAsync()

Asynchronously returns the first element of the query, or a default value if the the query result contains no elements.

FirstOrDefaultAsync(Func<TElement,Boolean>) FirstOrDefaultAsync(Func<TElement,Boolean>) FirstOrDefaultAsync(Func<TElement,Boolean>)

Asynchronously returns the first element of the query that satisfies a specified condition or a default value if no such element is found.

FirstOrDefaultAsync(CancellationToken) FirstOrDefaultAsync(CancellationToken) FirstOrDefaultAsync(CancellationToken)

Asynchronously returns the first element of the query, or a default value if the the query result contains no elements.

FirstOrDefaultAsync(Func<TElement,Boolean>, CancellationToken) FirstOrDefaultAsync(Func<TElement,Boolean>, CancellationToken) FirstOrDefaultAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously returns the first element of the query that satisfies a specified condition or a default value if no such element is found.

ForEachAsync(Action<TElement>) ForEachAsync(Action<TElement>) ForEachAsync(Action<TElement>)

Asynchronously enumerates the query results and performs the specified action on each element.

ForEachAsync(Action<TElement>, CancellationToken) ForEachAsync(Action<TElement>, CancellationToken) ForEachAsync(Action<TElement>, CancellationToken)

Asynchronously enumerates the query results and performs the specified action on each element.

GetEnumerator() GetEnumerator() GetEnumerator()

Returns an IEnumerator<T> which when enumerated will execute the SQL query against the database.

GetHashCode() GetHashCode() GetHashCode()
GetType() GetType() GetType()
LongCountAsync(CancellationToken) LongCountAsync(CancellationToken) LongCountAsync(CancellationToken)

Asynchronously returns an Int64 that represents the total number of elements in the query.

LongCountAsync(Func<TElement,Boolean>, CancellationToken) LongCountAsync(Func<TElement,Boolean>, CancellationToken) LongCountAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously returns an Int64 that represents the number of elements in the query that satisfy a condition.

LongCountAsync() LongCountAsync() LongCountAsync()

Asynchronously returns an Int64 that represents the total number of elements in the query.

LongCountAsync(Func<TElement,Boolean>) LongCountAsync(Func<TElement,Boolean>) LongCountAsync(Func<TElement,Boolean>)

Asynchronously returns an Int64 that represents the number of elements in the query that satisfy a condition.

MaxAsync() MaxAsync() MaxAsync()

Asynchronously returns the maximum value of the query.

MaxAsync(CancellationToken) MaxAsync(CancellationToken) MaxAsync(CancellationToken)

Asynchronously returns the maximum value of the query.

MinAsync() MinAsync() MinAsync()

Asynchronously returns the minimum value of the query.

MinAsync(CancellationToken) MinAsync(CancellationToken) MinAsync(CancellationToken)

Asynchronously returns the minimum value of the query.

SingleAsync() SingleAsync() SingleAsync()

Asynchronously returns the only element of the query, and throws an exception if there is not exactly one element in the sequence.

SingleAsync(Func<TElement,Boolean>) SingleAsync(Func<TElement,Boolean>) SingleAsync(Func<TElement,Boolean>)

Asynchronously returns the only element of the query that satisfies a specified condition, and throws an exception if more than one such element exists.

SingleAsync(CancellationToken) SingleAsync(CancellationToken) SingleAsync(CancellationToken)

Asynchronously returns the only element of the query, and throws an exception if there is not exactly one element in the sequence.

SingleAsync(Func<TElement,Boolean>, CancellationToken) SingleAsync(Func<TElement,Boolean>, CancellationToken) SingleAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously returns the only element of the query that satisfies a specified condition, and throws an exception if more than one such element exists.

SingleOrDefaultAsync(Func<TElement,Boolean>, CancellationToken) SingleOrDefaultAsync(Func<TElement,Boolean>, CancellationToken) SingleOrDefaultAsync(Func<TElement,Boolean>, CancellationToken)

Asynchronously returns the only element of the query that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

SingleOrDefaultAsync(CancellationToken) SingleOrDefaultAsync(CancellationToken) SingleOrDefaultAsync(CancellationToken)

Asynchronously returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.

SingleOrDefaultAsync() SingleOrDefaultAsync() SingleOrDefaultAsync()

Asynchronously returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.

SingleOrDefaultAsync(Func<TElement,Boolean>) SingleOrDefaultAsync(Func<TElement,Boolean>) SingleOrDefaultAsync(Func<TElement,Boolean>)

Asynchronously returns the only element of the query that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

ToArrayAsync() ToArrayAsync() ToArrayAsync()

Creates an array from the query by enumerating it asynchronously.

ToArrayAsync(CancellationToken) ToArrayAsync(CancellationToken) ToArrayAsync(CancellationToken)

Creates an array from the query by enumerating it asynchronously.

ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, IEqualityComparer<TKey>, CancellationToken) ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, IEqualityComparer<TKey>, CancellationToken) ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, IEqualityComparer<TKey>, CancellationToken)

Creates a Dictionary<TKey,TValue> from the query by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.

ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, CancellationToken) ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, CancellationToken) ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, CancellationToken)

Creates a Dictionary<TKey,TValue> from the query by enumerating it asynchronously according to a specified key selector and an element selector function.

ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, IEqualityComparer<TKey>) ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, IEqualityComparer<TKey>) ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>, IEqualityComparer<TKey>)

Creates a Dictionary<TKey,TValue> from the query by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.

ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>) ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>) ToDictionaryAsync<TKey,TResult>(Func<TElement,TKey>, Func<TElement,TResult>)

Creates a Dictionary<TKey,TValue> from the query by enumerating it asynchronously according to a specified key selector and an element selector function.

ToDictionaryAsync<TKey>(Func<TElement,TKey>, IEqualityComparer<TKey>, CancellationToken) ToDictionaryAsync<TKey>(Func<TElement,TKey>, IEqualityComparer<TKey>, CancellationToken) ToDictionaryAsync<TKey>(Func<TElement,TKey>, IEqualityComparer<TKey>, CancellationToken)

Creates a Dictionary<TKey,TValue> from the query by enumerating it asynchronously according to a specified key selector function and a comparer.

ToDictionaryAsync<TKey>(Func<TElement,TKey>) ToDictionaryAsync<TKey>(Func<TElement,TKey>) ToDictionaryAsync<TKey>(Func<TElement,TKey>)

Creates a Dictionary<TKey,TValue> from the query by enumerating it asynchronously according to a specified key selector function.

ToDictionaryAsync<TKey>(Func<TElement,TKey>, IEqualityComparer<TKey>) ToDictionaryAsync<TKey>(Func<TElement,TKey>, IEqualityComparer<TKey>) ToDictionaryAsync<TKey>(Func<TElement,TKey>, IEqualityComparer<TKey>)

Creates a Dictionary<TKey,TValue> from the query by enumerating it asynchronously according to a specified key selector function and a comparer.

ToDictionaryAsync<TKey>(Func<TElement,TKey>, CancellationToken) ToDictionaryAsync<TKey>(Func<TElement,TKey>, CancellationToken) ToDictionaryAsync<TKey>(Func<TElement,TKey>, CancellationToken)

Creates a Dictionary<TKey,TValue> from the query by enumerating it asynchronously according to a specified key selector function.

ToListAsync() ToListAsync() ToListAsync()

Creates a List<T> from the query by enumerating it asynchronously.

ToListAsync(CancellationToken) ToListAsync(CancellationToken) ToListAsync(CancellationToken)

Creates a List<T> from the query by enumerating it asynchronously.

ToString() ToString() ToString()

Returns a String that contains the SQL string that was set when the query was created. The parameters are not included.

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Returns an IEnumerator which when enumerated will execute the SQL query against the database.

IListSource.ContainsListCollection IListSource.ContainsListCollection IListSource.ContainsListCollection

Returns false.

IListSource.GetList() IListSource.GetList() IListSource.GetList()

Throws an exception indicating that binding directly to a store query is not supported.

IDbAsyncEnumerable.GetAsyncEnumerator() IDbAsyncEnumerable.GetAsyncEnumerator() IDbAsyncEnumerable.GetAsyncEnumerator()

Returns an IDbAsyncEnumerable which when enumerated will execute the SQL query against the database.

IDbAsyncEnumerable<TElement>.GetAsyncEnumerator() IDbAsyncEnumerable<TElement>.GetAsyncEnumerator() IDbAsyncEnumerable<TElement>.GetAsyncEnumerator()

Returns an IDbAsyncEnumerable<T> which when enumerated will execute the SQL query against the database.

Applies to