DbSqlQuery Class
Entity Framework 5.0
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 the Database. See DbSqlQuery(Of TEntity) for a generic version of this class.
Namespace: System.Data.Entity.Infrastructure
Assembly: EntityFramework (in EntityFramework.dll)
The DbSqlQuery type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | AsNoTracking | Returns a new query where the results of the query will not be tracked by the associated DbContext. |
![]() | Equals | Returns whether the specified query is equal to the current query. (Overrides Object.Equals(Object).) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetEnumerator | Executes the query and returns an enumerator for the elements. |
![]() | GetHashCode | Returns the hash function for the specified query. (Overrides Object.GetHashCode.) |
![]() | GetType | Gets the type for the current query. |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | 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 | |
|---|---|---|
![]() ![]() | IListSource.ContainsListCollection | Returns false. |
![]() ![]() | IListSource.GetList | Throws an exception indicating that binding directly to a store query is not supported. |
Show:

