RelationshipManager Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Container for the lazily created relationship navigation property objects (collections and refs).
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")]
[System.Serializable]
public class RelationshipManager
type RelationshipManager = class
Public Class RelationshipManager
- Inheritance
-
RelationshipManager
- Attributes
Methods
Create(IEntityWithRelationships) |
Creates a new RelationshipManager object. |
GetAllRelatedEnds() |
Returns an enumeration of all the related ends managed by the relationship manager. |
GetRelatedCollection<TTargetEntity>(String, String) |
Gets an EntityCollection<TEntity> of related objects with the specified relationship name and target role name. |
GetRelatedEnd(String, String) |
Returns either an EntityCollection<TEntity> or EntityReference<TEntity> of the correct type for the specified target role in a relationship. |
GetRelatedReference<TTargetEntity>(String, String) |
Gets the EntityReference<TEntity> for a related object by using the specified combination of relationship name and target role name. |
InitializeRelatedCollection<TTargetEntity>(String, String, EntityCollection<TTargetEntity>) |
Takes an existing EntityCollection that was created with the default constructor and initializes it using the provided relationship and target role names. This method is designed to be used during deserialization only, and will throw an exception if the provided EntityCollection has already been initialized, or if the relationship manager is already attached to a ObjectContext. |
InitializeRelatedReference<TTargetEntity>(String, String, EntityReference<TTargetEntity>) |
Takes an existing EntityReference that was created with the default constructor and initializes it using the provided relationship and target role names. This method is designed to be used during deserialization only, and will throw an exception if the provided EntityReference has already been initialized, if the relationship manager already contains a relationship with this name and target role, or if the relationship manager is already attached to a ObjectContext.W |
OnDeserialized(StreamingContext) |
Used internally to deserialize entity objects along with the RelationshipManager instances. |
OnSerializing(StreamingContext) |
Called by Object Services to prepare an EntityKey for binary serialization with a serialized relationship. |
Applies to
Entity Framework