ObjectContext.CreateEntityKey Method (String, Object)
Creates the entity key for a specific object, or returns the entity key if it already exists.
Assembly: EntityFramework (in EntityFramework.dll)
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.
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. |