public IActionResult EditNutrientIntake(int articleId, ArticleEditNutrientIntakeViewModel data) { if (!decimal.TryParse(data.Amount, out var amount)) { return(RedirectToAction("EditNutrientIntake", "Article", new { articleId = data.ArticleId, nutrientId = data.NutrientId })); } var nutrientIntake = new NutrientIntake { Amount = amount, Nutrient = _nutrientLogic.GetBy(data.NutrientId), }; if (_articleLogic.EditNutrientIntake(AuthController.GetAuthUserId(User), data.ArticleId, nutrientIntake)) { return(RedirectToAction("List", "Article")); } ViewData["message"] = "Er ging iets fout tijdens het wijzigen"; return(RedirectToAction("EditNutrientIntake", "Article", new { articleId = data.ArticleId, nutrientId = data.NutrientId })); }