EntityState.Modified does work differently on updating in EF Core vs EF 6

c# entity-framework-6 entity-framework-core

Accepted Answer

Your error states that your Student has a SchoolclassId value, but the foreign database for Schoolclasses does not have that value.

Prior to running SaveChanges, verify the value of SchoolclassId. Most likely, the Schoolclasses database does not include this value.

In other words, this issue is caused by a foreign key not being detected in the associated database rather than EF 6 vs. EF 7.

0
11/11/2016 7:38:11 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow