DbCollectionEntry<TEntity, TElement>.Query Method

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Returns the query that would be used to load this collection from the database. The returned query can be modified using LINQ to perform filtering or operations in the database, such as counting the number of entities in the collection in the database without actually loading them.

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

Syntax

'Declaration
Public Function Query As IQueryable(Of TElement)
'Usage
Dim instance As DbCollectionEntry 
Dim returnValue As IQueryable(Of TElement)

returnValue = instance.Query()
public IQueryable<TElement> Query()
public:
IQueryable<TElement>^ Query()
member Query : unit -> IQueryable<'TElement> 
public function Query() : IQueryable<TElement>

Return Value

Type: System.Linq.IQueryable<TElement>
A query for the collection.

See Also

Reference

DbCollectionEntry<TEntity, TElement> Class

System.Data.Entity.Infrastructure Namespace