ObjectContext.GetObjectByKey Method (EntityKey)
Returns an object that has the specified entity key.
Assembly: EntityFramework (in EntityFramework.dll)
Parameters
- key
-
Type:
System.Data.Entity.Core.EntityKey
The key of the object to be found.
Exception | Condition |
---|---|
ArgumentNullException | The key parameter is null. |
ObjectNotFoundException | The object is not found in either the ObjectStateManager or the data source. |