DbQuery Class

Definition

Represents a non-generic LINQ to Entities query against a DbContext.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
[System.Diagnostics.DebuggerDisplay("{DebuggerDisplay()}")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification="Casing is intentional")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="Name is intentional")]
public abstract class DbQuery : System.Collections.IEnumerable, System.ComponentModel.IListSource, System.Data.Entity.Infrastructure.IDbAsyncEnumerable, System.Linq.IOrderedQueryable
type DbQuery = class
    interface IOrderedQueryable
    interface IQueryable
    interface IEnumerable
    interface IListSource
    interface IDbAsyncEnumerable
Public MustInherit Class DbQuery
Implements IDbAsyncEnumerable, IEnumerable, IListSource, IOrderedQueryable
Inheritance
DbQuery
Derived
Attributes
Implements

Properties

ElementType

The IQueryable element type.

Sql

Gets a String representation of the underlying query.

Methods

AsNoTracking()

Returns a new query where the entities returned will not be cached in the DbContext.

AsStreaming()

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

Cast<TElement>()

Returns the equivalent generic DbQuery<TResult> object.

Equals(Object)
GetHashCode()
GetType()
Include(String)

Specifies the related objects to include in the query results.

ToString()

Returns a String representation of the underlying query.

Explicit Interface Implementations

IDbAsyncEnumerable.GetAsyncEnumerator()

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

IEnumerable.GetEnumerator()

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

IListSource.ContainsListCollection

Returns false.

IListSource.GetList()

Throws an exception indicating that binding directly to a store query is not supported. Instead populate a DbSet with data, for example by using the Load extension method, and then bind to local data. For WPF bind to DbSet.Local. For Windows Forms bind to DbSet.Local.ToBindingList().

IQueryable.Expression

The IQueryable LINQ Expression.

IQueryable.Provider

The IQueryable provider.

Applies to