EntityTypeBase.AddKeyMember Method (EdmMember)
Adds the specified property to the list of keys for the current entity.
Assembly: EntityFramework (in EntityFramework.dll)
Parameters
- member
-
Type:
System.Data.Entity.Core.Metadata.Edm.EdmMember
The property to add.
Exception | Condition |
---|---|
ArgumentNullException | if member argument is null |
InvalidOperationException | Thrown if the EntityType has a base type of another EntityTypeBase. In this case KeyMembers should be added to the base type |
InvalidOperationException | If the EntityType instance is in ReadOnly state |