public ActionResult AddFurniture() { FurnitureDb db = new FurnitureDb(_connectionString); AddFurnitureViewModel vm = new AddFurnitureViewModel { Count = db.GetTotalCount() }; return(View(vm)); }
public ActionResult AddFurniture(string name, string color, decimal price, int quantityInStock) { FurnitureDb db = new FurnitureDb(_connectionString); db.Add(new Furniture { Name = name, Color = color, Price = price, QuantityInStock = quantityInStock }); return(Redirect("/postdemo/AddFurniture")); }