Cascading Deletion in Entity Framework

So, I have two tables: Invoices and InvoiceItems. When I delete an invoice, I would like all invoiceItems related to it to be deleted.

I updated the relationship in SQL Server to cascade deletion when deleting an invoice. However, the Entity Framework did not recognize this change, but I read that I need to manually update EDMX to perform a cascading deletion.

Well in the design of my EDMX, I clicked on the relationship between the two tables and checked the properties to try and set my cascading delete

enter image description here

As you can see, there are two OnDelete properties: End1 OnDelete and End2 OnDelete

Which one do I need to install in Cascade?

+5
source share
2

End1 (I.e -, -), .

+5

, , , , , Devidigitals .

, .

, , InvoiceItems Invoice, - , , , , OnDelete -, , - , , - "-". End1.

, , , .

+7

All Articles