public ActionResult Create(Food food) { if (ModelState.IsValid) { var popup = new MessageInfo { State = 1, Message = "Nourriture bien ajouté" }; if (_dairyFarmService.AddFood(food) == false) { return(RedirectToAction("Index", "Foods", new { message = "Erreur dans l'ajout", state = 0 })); } return(RedirectToAction("Index", "Foods", new { message = popup.Message, state = popup.State })); } return(RedirectToAction("Index", "Foods", new { message = "Erreur dans l'ajout", state = 0 })); }