public IActionResult Add(Product prod) { var p = new Product(); p.Name = prod.Name; p.Price = prod.Price; p.Quantity = prod.Quantity; p.Type = prod.Type; var newInventory = _inventory.AddToInventory(p); return(RedirectToAction("Index", newInventory)); }
public void Add([FromBody] Product prod) { var p = new Product(); p.Name = prod.Name; p.Price = prod.Price; p.Quantity = prod.Quantity; p.Type = prod.Type; _inventory.AddToInventory(p); }