i have some issue with making primary key from 2 foregin keys
model examples: Element, Color, ElementToColor
ElementToColor should contain 2 foregin keys that representing the Element and Color relation
[Key,Column(Order = 1)]
public Int ElementId {get; set;}
[Key,Column(Order = 2)]
public Int ColorId {get; set;}
but when i tring to add the migration it's faild
ElementToColor must have primary key
but it's wrong to make primary key for that king of mapping table, it will make dublicate data
1,1,1
2,1,1
...
what should i do in that case
I use:
application: asp.net core 2.1 webApi
database: MySql
ORM: MySql EFCore