Returns an object that has the specified entity key.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
- Type: System.Data::EntityKey
The key of the object to be found.
- Type: System::Object%
When this method returns, contains the object.
Return ValueType: System::Boolean
true if the object was retrieved successfully. false if the key is temporary, the connection is nullptr, or the value is nullptr.
tries to retrieve an object that has the specified EntityKey from the ObjectStateManager. If the object is currently not loaded into the object context, a query is executed in an attempt to return the object from the data source. For more information, see Object Queries (Entity Framework).
This method will return objects in the Deleted state.
A temporary key cannot be used to return an object from the data source.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.