Is there an easy way to delete all child records for an item using Linq to sql?
是否有一种简单的方法可以使用Linq to sql删除一个条目的所有子记录?
1 个解决方案
#1
6
Something like this will work if there is a relationship between the tables:
如果表格之间有关系,类似这样的东西就会起作用:
var parent = // ...
context.Children.DeleteAllOnSubmit(parent.Children);
context.SubmitChanges();
#1
6
Something like this will work if there is a relationship between the tables:
如果表格之间有关系,类似这样的东西就会起作用:
var parent = // ...
context.Children.DeleteAllOnSubmit(parent.Children);
context.SubmitChanges();