public async Task <IActionResult> AddProduct(Product data) { try { if (ModelState.IsValid) { var id = _repository.AddProduct(data); return(RedirectToAction("AddIngredientToProduct", new { productId = id })); } return(View(data)); } catch (Exception ex) { return(View("Error", ex)); } }