DbRawSqlQuery<TElement> Class
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. See DbRawSqlQuery for a non-generic version of this class.
Assembly: EntityFramework (in EntityFramework.dll)
System.Data.Entity.Infrastructure.DbRawSqlQuery<TElement>
System.Data.Entity.Infrastructure.DbSqlQuery<TEntity>
[SuppressMessageAttribute("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] public class DbRawSqlQuery<TElement> : IEnumerable<TElement>, IEnumerable, IListSource, IDbAsyncEnumerable<TElement>, IDbAsyncEnumerable
Type Parameters
- TElement
The type of elements returned by the query.
Name | Description | |
---|---|---|
![]() | AllAsync(Func<TElement, Boolean>) | Asynchronously determines whether all the elements of the query satisfy a condition. |
![]() | AllAsync(Func<TElement, Boolean>, CancellationToken) | Asynchronously determines whether all the elements of the query satisfy a condition. |
![]() | AnyAsync() | Asynchronously determines whether the query contains any elements. |
![]() | AnyAsync(CancellationToken) | Asynchronously determines whether the query contains any elements. |
![]() | AnyAsync(Func<TElement, Boolean>) | Asynchronously determines whether any element of the query satisfies a condition. |
![]() | AnyAsync(Func<TElement, Boolean>, CancellationToken) | Asynchronously determines whether any element of the query satisfies a condition. |
![]() | AsStreaming() | Obsolete.Returns a new query that will stream the results instead of buffering. |
![]() | ContainsAsync(TElement) | Asynchronously determines whether the query contains a specified element by using the default equality comparer. |
![]() | ContainsAsync(TElement, CancellationToken) | Asynchronously determines whether the query contains a specified element by using the default equality comparer. |
![]() | CountAsync() | Asynchronously returns the number of elements in the query. |
![]() | CountAsync(CancellationToken) | Asynchronously returns the number of elements in the query. |
![]() | CountAsync(Func<TElement, Boolean>) | Asynchronously returns the number of elements in the query that satisfy a condition. |
![]() | CountAsync(Func<TElement, Boolean>, CancellationToken) | Asynchronously returns the number of elements in the query that satisfy a condition. |
![]() | Equals(Object) | Determines whether the current query is equal to the specified query.(Overrides Object.Equals(Object).) |
![]() | Finalize() | (Inherited from Object.) |
![]() | FirstAsync() | Asynchronously returns the first element of the query. |
![]() | FirstAsync(CancellationToken) | Asynchronously returns the first element of the query. |
![]() | FirstAsync(Func<TElement, Boolean>) | Asynchronously returns the first element of the query that satisfies a specified condition. |
![]() | FirstAsync(Func<TElement, Boolean>, CancellationToken) | Asynchronously returns the first element of the query that satisfies a specified condition. |
![]() | FirstOrDefaultAsync() | Asynchronously returns the first element of the query, or a default value if the the query result contains no elements. |
![]() | 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>) | Asynchronously returns the first element of the query that satisfies a specified condition or a default value if no such element is found. |
![]() | 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>) | Asynchronously enumerates the query results and performs the specified action on each element. |
![]() | ForEachAsync(Action<TElement>, CancellationToken) | Asynchronously enumerates the query results and performs the specified action on each element. |
![]() | GetEnumerator() | Returns an IEnumerator<T> which when enumerated will execute the SQL query against the database. |
![]() | GetHashCode() | Returns the hash function for this query.(Overrides Object.GetHashCode().) |
![]() | GetType() | Gets the type for the current query. |
![]() | LongCountAsync() | Asynchronously returns an Int64 that represents the total number of elements in the query. |
![]() | LongCountAsync(CancellationToken) | Asynchronously returns an Int64 that represents the total number of elements in the query. |
![]() | LongCountAsync(Func<TElement, Boolean>) | Asynchronously returns an Int64 that represents the number of elements in the query that satisfy a condition. |
![]() | LongCountAsync(Func<TElement, Boolean>, CancellationToken) | Asynchronously returns an Int64 that represents the number of elements in the query that satisfy a condition. |
![]() | MaxAsync() | Asynchronously returns the maximum value of the query. |
![]() | MaxAsync(CancellationToken) | Asynchronously returns the maximum value of the query. |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | MinAsync() | Asynchronously returns the minimum value of the query. |
![]() | MinAsync(CancellationToken) | Asynchronously returns the minimum value of the query. |
![]() | SingleAsync() | Asynchronously returns the only element of the query, and throws an exception if there is not exactly one element in the sequence. |
![]() | 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>) | 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(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() | 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(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(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. |
![]() | 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. |
![]() | ToArrayAsync() | Creates an array from the query by enumerating it asynchronously. |
![]() | ToArrayAsync(CancellationToken) | Creates an array from the query by enumerating it asynchronously. |
![]() | 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>, CancellationToken) | 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>) | 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>, 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, 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, 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>) | 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>, 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. |
![]() | ToListAsync() | Creates a List<T> from the query by enumerating it asynchronously. |
![]() | ToListAsync(CancellationToken) | Creates a List<T> from the query by enumerating it asynchronously. |
![]() | ToString() | Returns a String that contains the SQL string that was set when the query was created. The parameters are not included.(Overrides Object.ToString().) |
Name | Description | |
---|---|---|
![]() ![]() | IEnumerable.GetEnumerator() | Returns an IEnumerator which when enumerated will execute the SQL query against the database. |
![]() ![]() | IListSource.GetList() | Throws an exception indicating that binding directly to a store query is not supported. |
![]() ![]() | IDbAsyncEnumerable.GetAsyncEnumerator() | Returns an IDbAsyncEnumerable which when enumerated will execute the SQL query against the database. |
![]() ![]() | IDbAsyncEnumerable<TElement>.GetAsyncEnumerator() |
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.