Reputation: 64207
I've got an entity which is identified by no own id but an unique combination of properties, each of which is a foreign key.
But Entity Framework designer does not seem to allow to make a foreign key (a "navigation property") a part of a primary key. Am I misunderstanding something or is it just unsupported?
Example:
here an instrument is designated by a very short symbolic identifier (name), which doesn't seem to be wise to be replaced by a numeric code.
Upvotes: 2
Views: 1689
Reputation: 364269
Navigation properties cannot be part of primary key. Composite primary key (entity key) can consists only from scalar properties -> only foreign properties related to these navigation properties can be part of FK - here is the example of the model which uses such relation.
Upvotes: 4