EntityReference<TEntity>.CreateSourceQuery Method ()

 

Creates an equivalent object query that returns the related object.

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 returns the related object.

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.