Linq-单条数据删除

单条数据删除,用DeleteOnSubmit

NorthwindDataContext db = new NorthwindDataContext();
Customer test1 = ctx.Customers.Single(c => c.CustomerID == 1);
db.t_sysrole.DeleteOnSubmit(test1);
db.SubmitChanges();

 

posted @ 2016-07-04 13:44  dekevin  阅读(624)  评论(0编辑  收藏  举报