How EF Code first sets up a composite primary key
In addition to the simple many-to-many relational table, we may add other attributes to the relational table: for example, "order line" corresponding to "orders" and "goods" need more than one quantity field
And don't want to add a separate primary key that doesn't really make sense on this order Line table.
This thought that Fluentapi call 2 times haskey (property) can be 2 foreign key fields into a composite primary key, the results found that only the next set of the primary key to play a role, ask Q Group to the following annotated way
Since it can be implemented in the form of annotations, the Fluentapi approach is certainly possible:
Easier to find;
The method Haskey (XXX) that sets the primary key in Ps:fluentapi overrides the previous haskey () setting
C # Normal encounter problems "6"