Used to track relationships between objects in the object context.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
Thetype exposes the following members.
|Create||Creates a new object.|
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetAllRelatedEnds||Returns an enumeration of all the related ends managed by the relationship manager.|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetRelatedCollection(TTargetEntity)||Gets an EntityCollection(TEntity) of related objects with the specified relationship name and target role name.|
|GetRelatedEnd||Returns either an EntityCollection(TEntity) or EntityReference(TEntity) of the correct type for the specified target role in a relationship.|
|GetRelatedReference(TTargetEntity)||Gets the EntityReference(TEntity) for a related object by using the specified combination of relationship name and target role name.|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|InitializeRelatedCollection(TTargetEntity)||Initializes an existing EntityCollection(TEntity) that was created by using the default constructor.|
|InitializeRelatedReference(TTargetEntity)||Initializes an existing EntityReference(TEntity) that was created by using the default constructor.|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|OnDeserialized||Infrastructure. Used internally to deserialize entity objects along with the instances.|
|OnSerializing||Called by Object Services to prepare an EntityKey for binary serialization with a serialized relationship.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
is used to track relationships between objects in an object context. There is one instance of the class for each relationship tracked in the object context. Relationships are defined by associations in a conceptual model. For more information, see Association (EDM).
The example in this topic is based on the Adventure Works Sales Model. The example adds new SalesOrderHeader entities to the Contact entity. Then it gets all related ends from the Contact entity and displays the relationship name, source role name, and target role name for each related end.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.