Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ObjectContext::TryGetObjectByKey Method (EntityKey^, Object^)

Entity Framework 6.0
 

Returns an object that has the specified entity key.

Namespace:   System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.dll)

public:
[SuppressMessageAttribute("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")]
virtual bool TryGetObjectByKey(
	EntityKey^ key,
	[OutAttribute] Object^% value
)

Parameters

key
Type: System.Data.Entity.Core::EntityKey^

The key of the object to be found.

value
Type: System::Object^

When this method returns, contains the object.

Return Value

Type: System::Boolean

true if the object was retrieved successfully. false if the key is temporary, the connection is null, or the value is null.

Exception Condition
ArgumentException

Incompatible metadata for key .

ArgumentNullException

key is null.

Return to top
Show: