ObjectStateManager.TryGetObjectStateEntry Method

 

Attempts to retrieve 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_pubmethodTryGetObjectStateEntry(EntityKey, ObjectStateEntry)

Tries to retrieve the corresponding ObjectStateEntry for the object or relationship with the specified EntityKey .

System_CAPS_pubmethodTryGetObjectStateEntry(Object, ObjectStateEntry)

Tries to retrieve the corresponding ObjectStateEntry for the specified Object .


ObjectStateManager.TryGetObjectStateEntry Method (EntityKey, ObjectStateEntry)

Tries to retrieve the corresponding ObjectStateEntry for the object or relationship with the specified EntityKey .

public virtual bool TryGetObjectStateEntry(
	EntityKey key,
	out ObjectStateEntry entry
)

Parameters

key
Type: System.Data.Entity.Core.EntityKey

The given EntityKey.

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

When this method returns, contains an ObjectStateEntry for the given EntityKey This parameter is passed uninitialized.

Return Value

Type: System.Boolean

A Boolean value that is true if there is a corresponding ObjectStateEntry for the given EntityKey ; otherwise, false.

Exception Condition
ArgumentNullException

A null (Nothing in Visual Basic) value is provided for key .


ObjectStateManager.TryGetObjectStateEntry Method (Object, ObjectStateEntry)

Tries to retrieve the corresponding ObjectStateEntry for the specified Object .

public virtual bool TryGetObjectStateEntry(
	object entity,
	out ObjectStateEntry entry
)

Parameters

entity
Type: System.Object

The Object to which the retrieved ObjectStateEntry belongs.

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

When this method returns, contains the ObjectStateEntry for the given EntityKey This parameter is passed uninitialized.

Return Value

Type: System.Boolean

A Boolean value that is true if there is a corresponding ObjectStateEntry for the given object; otherwise, false.