I'm using EF 6 Code-First with Database Exists and created a simple Person and Pet classes.
Like this article.
http://ift.tt/1rSbP9e
Cascade deletes are working fine, child inserts are working fine but child deletes are not working.
I get the following error.
The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted.
I am using SQLite with EF6.
There are no Foreign Key's in the database.
I used the example article word-for-word... There solution of adding event handlers on the collection did not work because the "Pets" is always empty.
Even when I use the "Include" for Pets and set LazyLoadingEnable = false.
Any thoughts?
Aucun commentaire:
Enregistrer un commentaire