ObjectStateManager.GetObjectStateEntry Method

 

Retrieves the corresponding ObjectStateEntry for the given System.Data.Entity.Core.EntityKey.

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

NameDescription
System_CAPS_pubmethodGetObjectStateEntry(EntityKey)

Returns an ObjectStateEntry for the object or relationship entry with the specified key.

System_CAPS_pubmethodGetObjectStateEntry(Object)

Returns an ObjectStateEntry for the specified object.


ObjectStateManager.GetObjectStateEntry Method (EntityKey)

Returns an ObjectStateEntry for the object or relationship entry with the specified key.

public virtual ObjectStateEntry GetObjectStateEntry(
	EntityKey key
)

Return Value

Type: System.Data.Entity.Core.Objects.ObjectStateEntry

The corresponding ObjectStateEntry for the given EntityKey .

Exception Condition
ArgumentNullException

When key is null.

ArgumentException

When the specified key cannot be found in the state manager.

InvalidOperationException

No entity with the specified EntityKey exists in the ObjectStateManager .


ObjectStateManager.GetObjectStateEntry Method (Object)

Returns an ObjectStateEntry for the specified object.

public virtual ObjectStateEntry GetObjectStateEntry(
	object entity
)

Parameters

entity
Type: System.Object

The Object to which the retrieved ObjectStateEntry belongs.

Return Value

Type: System.Data.Entity.Core.Objects.ObjectStateEntry

The corresponding ObjectStateEntry for the given Object .

Exception Condition
InvalidOperationException

No entity for the specified Object exists in the ObjectStateManager .