views:

31

answers:

1

Is there an easy way to delete all child records for an item using Linq to sql?

+2  A: 

Something like this will work if there is a relationship between the tables:

var parent = // ...
context.Children.DeleteAllOnSubmit(parent.Children);
context.SubmitChanges();
kbrimington