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::CreateEntityKey Method (String^, Object^)

Entity Framework 6.0
 

Creates the entity key for a specific object, or returns the entity key if it already exists.

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

public:
virtual EntityKey^ CreateEntityKey(
	String^ entitySetName,
	Object^ entity
)

Parameters

entitySetName
Type: System::String^

The fully qualified name of the entity set to which the entity object belongs.

entity
Type: System::Object^

The object for which the entity key is being retrieved.

Return Value

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

The EntityKey of the object.

Exception Condition
ArgumentNullException

When either parameter is null.

ArgumentException

When entitySetName is empty or when the type of the entity object does not exist in the entity set or when the entitySetName is not fully qualified.

InvalidOperationException

When the entity key cannot be constructed successfully based on the supplied parameters.

Return to top
Show: