ObjectContext.GetObjectByKey(EntityKey) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework