ObjectContext.TryGetObjectByKey(EntityKey, Object) 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.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")]
public virtual bool TryGetObjectByKey (System.Data.Entity.Core.EntityKey key, out object value);
abstract member TryGetObjectByKey : System.Data.Entity.Core.EntityKey * -> bool
override this.TryGetObjectByKey : System.Data.Entity.Core.EntityKey * -> bool
Public Overridable Function TryGetObjectByKey (key As EntityKey, ByRef value As Object) As Boolean
Parameters
- key
- EntityKey
The key of the object to be found.
- value
- Object
When this method returns, contains the object.
Returns
true if the object was retrieved successfully. false if the key is temporary, the connection is null, or the value is null.
- Attributes
Exceptions
Incompatible metadata for key .
key is null.
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