public ActionResult Add(Product product) { db.Products.Add(product); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Add(Basket basket) { if (ModelState.IsValid) { db.Baskets.Add(basket); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(basket)); }
public ActionResult Create([Bind(Include = "IDUser,Password,ConfirmPassword,Surname,Name,Patronymic,BirthDay,Mail,Phone,Address")] User user) { if (ModelState.IsValid) { db.Users.Add(user); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Add(Order order) { if (ModelState.IsValid) { db.Orders.Add(order); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(order)); }
public virtual void Add(Basket entity) { dbSet.Add(entity); db.SaveChanges(); }
public virtual void Add(Product entity) { dbSet.Add(entity); db.SaveChanges(); }
public virtual void Add(Order entity) { dbSet.Add(entity); db.SaveChanges(); }
public void Save() { _db.SaveChanges(); }