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.

Namespace:   System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

System.Object
  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.

NameDescription
System_CAPS_pubmethodAllAsync(Func<TElement, Boolean>)

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

System_CAPS_pubmethodAllAsync(Func<TElement, Boolean>, CancellationToken)

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

System_CAPS_pubmethodAnyAsync()

Asynchronously determines whether the query contains any elements.

System_CAPS_pubmethodAnyAsync(CancellationToken)

Asynchronously determines whether the query contains any elements.

System_CAPS_pubmethodAnyAsync(Func<TElement, Boolean>)

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

System_CAPS_pubmethodAnyAsync(Func<TElement, Boolean>, CancellationToken)

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

System_CAPS_pubmethodAsStreaming()

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

System_CAPS_pubmethodContainsAsync(TElement)

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

System_CAPS_pubmethodContainsAsync(TElement, CancellationToken)

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

System_CAPS_pubmethodCountAsync()

Asynchronously returns the number of elements in the query.

System_CAPS_pubmethodCountAsync(CancellationToken)

Asynchronously returns the number of elements in the query.

System_CAPS_pubmethodCountAsync(Func<TElement, Boolean>)

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

System_CAPS_pubmethodCountAsync(Func<TElement, Boolean>, CancellationToken)

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

System_CAPS_pubmethodEquals(Object)

Determines whether the current query is equal to the specified query.(Overrides Object.Equals(Object).)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodFirstAsync()

Asynchronously returns the first element of the query.

System_CAPS_pubmethodFirstAsync(CancellationToken)

Asynchronously returns the first element of the query.

System_CAPS_pubmethodFirstAsync(Func<TElement, Boolean>)

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

System_CAPS_pubmethodFirstAsync(Func<TElement, Boolean>, CancellationToken)

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

System_CAPS_pubmethodFirstOrDefaultAsync()

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

System_CAPS_pubmethodFirstOrDefaultAsync(CancellationToken)

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

System_CAPS_pubmethodFirstOrDefaultAsync(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.

System_CAPS_pubmethodFirstOrDefaultAsync(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.

System_CAPS_pubmethodForEachAsync(Action<TElement>)

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

System_CAPS_pubmethodForEachAsync(Action<TElement>, CancellationToken)

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

System_CAPS_pubmethodGetEnumerator()

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

System_CAPS_pubmethodGetHashCode()

Returns the hash function for this query.(Overrides Object.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the type for the current query.

System_CAPS_pubmethodLongCountAsync()

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

System_CAPS_pubmethodLongCountAsync(CancellationToken)

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

System_CAPS_pubmethodLongCountAsync(Func<TElement, Boolean>)

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

System_CAPS_pubmethodLongCountAsync(Func<TElement, Boolean>, CancellationToken)

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

System_CAPS_pubmethodMaxAsync()

Asynchronously returns the maximum value of the query.

System_CAPS_pubmethodMaxAsync(CancellationToken)

Asynchronously returns the maximum value of the query.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodMinAsync()

Asynchronously returns the minimum value of the query.

System_CAPS_pubmethodMinAsync(CancellationToken)

Asynchronously returns the minimum value of the query.

System_CAPS_pubmethodSingleAsync()

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

System_CAPS_pubmethodSingleAsync(CancellationToken)

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

System_CAPS_pubmethodSingleAsync(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.

System_CAPS_pubmethodSingleAsync(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.

System_CAPS_pubmethodSingleOrDefaultAsync()

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.

System_CAPS_pubmethodSingleOrDefaultAsync(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.

System_CAPS_pubmethodSingleOrDefaultAsync(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.

System_CAPS_pubmethodSingleOrDefaultAsync(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.

System_CAPS_pubmethodToArrayAsync()

Creates an array from the query by enumerating it asynchronously.

System_CAPS_pubmethodToArrayAsync(CancellationToken)

Creates an array from the query by enumerating it asynchronously.

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

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

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

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

System_CAPS_pubmethodToDictionaryAsync<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.

System_CAPS_pubmethodToDictionaryAsync<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.

System_CAPS_pubmethodToDictionaryAsync<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.

System_CAPS_pubmethodToDictionaryAsync<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.

System_CAPS_pubmethodToDictionaryAsync<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.

System_CAPS_pubmethodToDictionaryAsync<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.

System_CAPS_pubmethodToListAsync()

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

System_CAPS_pubmethodToListAsync(CancellationToken)

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

System_CAPS_pubmethodToString()

Returns a String that contains the SQL string that was set when the query was created. The parameters are not included.(Overrides Object.ToString().)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIListSource.GetList()

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDbAsyncEnumerable.GetAsyncEnumerator()

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDbAsyncEnumerable<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.