ObjectStateManager.GetRelationshipManager Method (Object)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns the RelationshipManager that is used by the specified object.

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

public RelationshipManager GetRelationshipManager(
	object entity


Type: System.Object

The object for which to return the RelationshipManager.

Return Value

Type: System.Data.Objects.DataClasses.RelationshipManager

The RelationshipManager for the specified object.

Exception Condition

When a RelationshipManager cannot be returned for the specified entity.

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.

.NET Framework
Available since 4.0
Return to top