EntityReference<TEntity>::CreateSourceQuery Method ()
.NET Framework (current version)
Creates an equivalent object query that returns the related object.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
Return Value
Type: System.Data.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. |
This method is used to obtain a new instance of ObjectQuery<T> that, when it is executed, returns the related object. This is useful as the starting point for a more complex join, union, or filtered query, or to return the referenced object in a detached state using the NoTracking option.
.NET Framework
Available since 3.5
Available since 3.5
Show: