Load Method
Collapse the table of content
Expand the table of content

RelatedEnd.Load Method ()


When overridden in a derived class, loads the related object or objects into the related end with the default merge option.

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

public void Load()

Exception Condition

When the source object was retrieved by using a NoTracking query and the MergeOption is not NoTracking or the related objects are already loaded.


When the source object is not attached to the ObjectContext.


When the source object is being tracked but is in the Added or Deleted state or the MergeOption used for Load is NoTracking.

The default merge option is AppendOnly for tracked objects or NoTracking when the object is not tracked in the ObjectStateManager. To specify a merge option other than AppendOnly, call the Load method on the EntityCollection<TEntity> or the EntityReference<TEntity> that takes a specific MergeOption parameter.

Calling the Load method sets the IsLoaded flag to true.

The Load method loads related objects from the data source whether or not IsLoaded is true.

.NET Framework
Available since 3.5
Return to top
© 2015 Microsoft