Ejemplo n.º 1
0
 static void Modify()
 {
     NorthwindDataContext context = new NorthwindDataContext();
     var result = context.Categories.Where<Category>((cat) => (cat.CategoryID == 48090)).Single<Category>();
     result.CategoryName = "Thurston";
     context.SubmitChanges();
 }
Ejemplo n.º 2
0
 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();
 }