DbSqlQuery Class

 

Represents a SQL query for entities that is created from a DbContext and is executed using the connection from that context. Instances of this class are obtained from the DbSet instance for the entity type. 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 non-entities are created using SqlQuery. See DbSqlQuery<TEntity> for a generic version of this class.

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

System.Object
  System.Data.Entity.Infrastructure.DbRawSqlQuery
    System.Data.Entity.Infrastructure.DbSqlQuery

[SuppressMessageAttribute("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
[SuppressMessageAttribute("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
public class DbSqlQuery : DbRawSqlQuery

NameDescription
System_CAPS_protmethodDbSqlQuery()

Creates an instance of a DbSqlQuery when called from the constructor of a derived type that will be used as a test double for SqlQuery. Methods and properties that will be used by the test double must be implemented by the test double except AsNoTracking and AsStreaming where the default implementation is a no-op.

NameDescription
System_CAPS_pubmethodAsNoTracking()

Returns a new query where the results of the query will not be tracked by the associated DbContext.

System_CAPS_pubmethodAsStreaming()

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

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current instance.(Overrides DbRawSqlQuery.Equals(Object).)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodForEachAsync(Action<Object>)

Asynchronously enumerates the query results and performs the specified action on each element.(Inherited from DbRawSqlQuery.)

System_CAPS_pubmethodForEachAsync(Action<Object>, CancellationToken)

Asynchronously enumerates the query results and performs the specified action on each element.(Inherited from DbRawSqlQuery.)

System_CAPS_pubmethodGetEnumerator()

Returns an IEnumerator which when enumerated will execute the SQL query against the database.(Inherited from DbRawSqlQuery.)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for the current instance.(Overrides DbRawSqlQuery.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the type associated with the query.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToListAsync()

Creates a List<T> from the query by enumerating it asynchronously.(Inherited from DbRawSqlQuery.)

System_CAPS_pubmethodToListAsync(CancellationToken)

Creates a List<T> from the query by enumerating it asynchronously.(Inherited from DbRawSqlQuery.)

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 DbRawSqlQuery.ToString().)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIListSource.GetList()

Throws an exception indicating that binding directly to a store query is not supported.(Inherited from DbRawSqlQuery.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDbAsyncEnumerable.GetAsyncEnumerator()

Returns an IDbAsyncEnumerable which when enumerated will execute the SQL query against the database.(Inherited from DbRawSqlQuery.)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: