-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete an owned entity on update? #135
Comments
This is most likely an EF-configuration issue. The default relation in EF for a one-way nav property is one-to-many. (It doesn't know Address is unique to this customer) Try setting your config to: |
I used HasOptional(c => c.Address).WithRequired(). However, it doesn't work because the address is now not being set in the customer although the correct SQL statement is being used. |
This issue is still not solved. Could it be because I'm not using EF's default naming conventions? |
I am having the same issue. |
I had similar issues, fixed both in OwnedEntityGraphNode's Update method below..
Old version of code
|
I have the following model:
I load an existing customer with his address, and I want to delete address, so I do:
The customer's address id is set to null correctly. However the address is not being deleted from the db. How can I delete the owned entity from the db?
The text was updated successfully, but these errors were encountered: