// // Products/Create public ActionResult Create() { var product = new Product(); UpdateModel( product, Request.Form.AllKeys ); northwind.AddProduct( product ); northwind.SubmitChanges(); return RedirectToAction( "Category", new { ID = product.CategoryID } ); }
// Add a New Product public void AddProduct( Product product ) { Products.InsertOnSubmit( product ); }
partial void DeleteProduct( Product instance );
partial void UpdateProduct( Product instance );
partial void InsertProduct( Product instance );
private void detach_Products( Product entity ) { SendPropertyChanging(); entity.Category = null; }
private void attach_Products( Product entity ) { SendPropertyChanging(); entity.Category = this; }
private void detach_Products( Product entity ) { SendPropertyChanging(); entity.Supplier = null; }
private void attach_Products( Product entity ) { SendPropertyChanging(); entity.Supplier = this; }