Defines the end of a relationship.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
Thetype exposes the following members.
|IsLoaded||Gets a value that indicates whether all related objects have been loaded.|
|RelationshipName||Gets the name of the relationship in which this related end participates.|
|RelationshipSet||Returns a reference to the metadata for the related end.|
|SourceRoleName||Gets the role name at the source end of the relationship.|
|TargetRoleName||Gets the role name at the target end of the relationship.|
|Add(IEntityWithRelationships)||Adds an object to the related end.|
|Add(Object)||Adds an object to the related end.|
|Attach(IEntityWithRelationships)||Defines a relationship between two attached objects.|
|Attach(Object)||Defines a relationship between two attached objects.|
|CreateSourceQuery||Returns an IEnumerable that represents the objects that belong to the related end.|
|GetEnumerator||Returns an IEnumerator that iterates through the collection of related objects.|
|Load()||Loads the related object or objects into this related end with the default merge option.|
|Load(MergeOption)||Loads the related object or objects into the related end with the specified merge option.|
|Remove(IEntityWithRelationships)||Removes an object from the collection of objects at the related end.|
|Remove(Object)||Removes an object from the collection of objects at the related end.|
The following example adds new SalesOrderHeader entities to the Contact entity. Then it gets all related ends from the Contact entity and displays relationship name, source role name, and target role name for each related end.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.