Edit

Share via


ObjectStateManager.GetRelationshipManager(Object) Method

Definition

Returns the RelationshipManager that is used by the specified object.

public:
 System::Data::Objects::DataClasses::RelationshipManager ^ GetRelationshipManager(System::Object ^ entity);
public System.Data.Objects.DataClasses.RelationshipManager GetRelationshipManager (object entity);
member this.GetRelationshipManager : obj -> System.Data.Objects.DataClasses.RelationshipManager
Public Function GetRelationshipManager (entity As Object) As RelationshipManager

Parameters

entity
Object

The object for which to return the RelationshipManager.

Returns

The RelationshipManager for the specified object.

Exceptions

When a RelationshipManager cannot be returned for the specified entity.

Remarks

Calling the GetRelationshipManager method is the same as calling the TryGetRelationshipManager method, except that this method raises an exception instead of returning false.

Call the TryGetRelationshipManager method to avoid handling the InvalidOperationException that occurs when a RelationshipManager cannot be returned for the supplied entity.

Applies to