I have a table A that has a foreign key relation to another table B. First I delete an entry (a) in A using raw SQL. Later I delete an entry in table B, b, which was the entry that a was pointing to. When I do this, EntityFramework fails with the error message:
The association between entity types 'B' and 'A' has been severed but the relationship is either marked as 'Required' or is implicitly required because the foreign key is not nullable.
I assume that it is because the context gets out of sync with the database. How do I fix this?