public ActionResult AddInventory(InventoryViewModel model) { if (ModelState.IsValid) { InventoryRepository inventoryRepository = new InventoryRepository(new ApplicationDbContext()); inventoryRepository.Create(model); return RedirectToAction("Inventories"); } return View(model); }
public ActionResult AddInventory() { var model = new InventoryViewModel(); return View(model); }