ObjectStateManager::GetObjectStateEntry Method (Object^)

 

Returns an ObjectStateEntry for the specified object.

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

public:
ObjectStateEntry^ GetObjectStateEntry(
	Object^ entity
)

Parameters

entity
Type: System::Object^

The Object to which the retrieved ObjectStateEntry belongs.

Return Value

Type: System.Data.Objects::ObjectStateEntry^

The corresponding ObjectStateEntry for the given Object.

Exception Condition
InvalidOperationException

No entity for the specified Object exists in the ObjectStateManager.

Use the TryGetObjectStateEntry(Object^, ObjectStateEntry^%) method to return an ObjectStateEntry object without having to handle the InvalidOperationException raised by the GetObjectStateEntry(Object^) method.

.NET Framework
Available since 3.5
Return to top
Show: