The ________ Fluent API method is utilized to configure a composite primary key in an Entity Type.

  • HasKey
  • CompositeKey
  • PrimaryKey
  • HasPrimaryKeys
The correct option is Option 2: CompositeKey. This method in Entity Framework's Fluent API is specifically designed to configure a composite primary key for an entity type. A composite primary key consists of more than one property that uniquely identifies a record in a table. By using CompositeKey, you can specify multiple properties to form the composite key, ensuring uniqueness across the combination of these properties.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *