static void Modify() { NorthwindDataContext context = new NorthwindDataContext(); var result = context.Categories.Where<Category>((cat) => (cat.CategoryID == 48090)).Single<Category>(); result.CategoryName = "Thurston"; context.SubmitChanges(); }
static void MyDel() { NorthwindDataContext context = new NorthwindDataContext(); var result = (from item in context.Categories where item.CategoryID == 48090 select item).Single<Category>(); context.Categories.DeleteOnSubmit(result); context.Products.DeleteAllOnSubmit<Product>(result.Products); context.SubmitChanges(); }