public ActionResult AddStore() { if (Request.Form["name"] != null) { store store = new store { name = Request.Form["name"].ToString(), }; db.stores.InsertOnSubmit(store); try { db.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e); // Make some adjustments. // ... // Try again. db.SubmitChanges(); } return RedirectToAction("Index", "Stores"); } return View(); }
partial void Deletestore(store instance);
partial void Updatestore(store instance);
partial void Insertstore(store instance);