EntityCollection<TEntity>.CreateSourceQuery Method ()

 

Returns an object query that, when it is executed, returns the same set of objects that exists in the current collection.

Namespace:   System.Data.Entity.Core.Objects.DataClasses
Assembly:  EntityFramework (in EntityFramework.dll)

public ObjectQuery<TEntity> CreateSourceQuery()

Return Value

Type: System.Data.Entity.Core.Objects.ObjectQuery<TEntity>

An ObjectQuery<T> that represents the entity collection.

Exception Condition
InvalidOperationException

When the object is in an Added state or when the object is in a Detached state with a MergeOption other than NoTracking.