I'm using Entity Frame Core Code First with an ASP MVC project I'm working on.
I have a table with two foreign keys that reference the same table. I followed this great example: Entity Framework Code First - two Foreign Keys from same table
How can I enforce it so that the value combinations can only exist once?
i.e.
Id Value1 Value
1 1 2 --This is ok
2 1 3 --This is ok
3 1 2 --This is bad. Duplicate combination
4 3 1 --This is bad. This is just the reverse of Id 2
Thank you.