I have a table that looks like this:
TABLE Foo
{
Guid Id [PK],
int A [FK],
int B [FK],
int C [FK],
}
And a unique restriction over A, B and C.
Now let's say, for example, you insert a row with a fresh PK with A = 1, B = 1, C = 1.
SubmitChanges(), everyone is happy.
Now you are editing the table.
You delete the previous entry and insert the row with PK Fresk with A = 1, B = 1, C = 1.
SubmitChanges()BOOM! Exception of an exclusive key SQL constraint.
From what I see, he tries to insert a new record first, and then try to delete the previous one. I can even understand that it is impossible to determine the order that should happen.
But what can I do about it? Would make these 3 fields a composite PK (and deleting the old one) better, or even not working?
"" - ( ).