public ActionResult Create(IngredientAdvice ingredientAdvice, FormCollection form)
        {
            //if (ModelState.IsValid)
            //{

            //Ingredient ingredient = new Ingredient();
            // Deserialize (Include white list!)
            //bool isModelUpdated = TryUpdateModel(ingredientAdvice,
            //                                     new[]
            //                                         {
            //                                             "IngredientsId", "Label", "Introduction", "Advice", "KeyWords",
            //                                             "Semaphore", "Published"
            //                                         }, form.ToValueProvider());

            // Validate

            if (ingredientAdvice.IngredientsId == null)
            {
                ModelState.AddModelError("IngredientsId", "Please choose an ingredient.");
            }
            ValidateAdvice(ingredientAdvice);
            if (ModelState.IsValid)
            {
                try
                {
                    _adviceApplicationService.AddIngredientAdvice(CurrentMentor, ingredientAdvice);

                    return RedirectToAction("Index", "Advice");
                }
                catch
                {
                    return RedirectToAction("Create");
                }
            }
            var ingredients = _ingredientApplicationService.GetAllIngredients();
            ViewData["Ingredients"] = new SelectList(ingredients, "Id", "IngredientName", ingredientAdvice.IngredientsId) ;
            ViewData["Semaphores"] = _semaphoreApplicationService.GetAllSemaphores();
            return View(ingredientAdvice);
        }
 public ActionResult Edit(IngredientAdvice ingredientAdvice, FormCollection form)
 {
     ValidateAdvice(ingredientAdvice);
     if (ModelState.IsValid)
     {
         _adviceApplicationService.UpdateAdvice(ingredientAdvice);
         return RedirectToAction("Index", "Advice");
     }
     ViewData["Semaphores"] = _semaphoreApplicationService.GetAllSemaphores();
     var advice = _adviceApplicationService.GetAdvice(ingredientAdvice.Id.Value) as IngredientAdvice;
     var ingredient = _ingredientApplicationService.GetIngredientById(advice.IngredientsId.Value);
     ViewData["Ingredient"] = ingredient;
     return View(advice);
 }