Share via


ObjectContext.GetObjectByKey(EntityKey) Method

Definition

Returns an object that has the specified entity key.

public virtual object GetObjectByKey (System.Data.Entity.Core.EntityKey key);
abstract member GetObjectByKey : System.Data.Entity.Core.EntityKey -> obj
override this.GetObjectByKey : System.Data.Entity.Core.EntityKey -> obj
Public Overridable Function GetObjectByKey (key As EntityKey) As Object

Parameters

key
EntityKey

The key of the object to be found.

Returns

An Object that is an instance of an entity type.

Exceptions

The key parameter is null.

The object is not found in either the ObjectStateManager or the data source.

Applies to