The PrimaryKey method of the EntityConfiguration class is used to define the list of the properties of a primary key. This method returns an instance of the PrimaryKeyConfiguration class.
The example of defining a primary key, which consists of one property:
The example of defining a complex primary key:
The example of a database-generated primary key: