c# - Cascading delete in Entity Framework -
so have 2 tables, invoices , invoiceitems. when delete invoice, i'd related invoiceitems deleted well.
i updated relationship in sql server cascading delete when delete invoice. entity framework didn't recognize change, however, i've read need manually update edmx cascading delete.
well in design view of edmx, clicked on relationship between 2 tables, , checked properties try , set cascading delete
as can see, there 2 ondelete properties: end1 ondelete , end2 ondelete
which 1 need set cascade?
if end1 principal of relationship (i.e invoice has invoice items) makes sense cascade deletes.
Comments
Post a Comment