public ActionResult Update(int id)
        {
            var recipeBL = recipeService.GetRecipeByID(id);
            var recipe   = new RecipeViewModel()
            {
                RecipeID        = recipeBL.RecipeID,
                CookTime        = recipeBL.CookTime,
                Description     = recipeBL.Description,
                LongDescription = recipeBL.LongDescription,
                Name            = recipeBL.Name,
                RatingID        = recipeBL.RatingID,
                PictureLocation = recipeBL.PictureLocation,
                PrepTime        = recipeBL.PrepTime
            };
            var categoriesBL     = categoryService.GetAllCategoriesForRecipe(recipe.RecipeID);
            var listOfCategories = new List <CategoryViewModel>();

            var allCategoriesBL = categoryService.GetAllCategories();

            var subcategoriesBL     = subcategoryService.GetAllSubCategoriesForRecipe(recipe.RecipeID);
            var listOfSubcategories = new List <SubcategoryViewModel>();

            var allSubcategoriesBL = subcategoryService.GetAllSubcategories();


            foreach (var c in allCategoriesBL)
            {
                if (categoriesBL.Any(prod => prod.Name == c.Name))
                {
                    listOfCategories.Add(new CategoryViewModel
                    {
                        IsSelected = true,
                        CategoryID = c.CategoryID,
                        Name       = c.Name
                    });
                }
                else
                {
                    listOfCategories.Add(new CategoryViewModel
                    {
                        IsSelected = false,
                        CategoryID = c.CategoryID,
                        Name       = c.Name
                    });
                }
            }



            foreach (var i in listOfCategories)
            {
                recipe.Categories.Add(i);
            }

            foreach (var c in allSubcategoriesBL)
            {
                if (subcategoriesBL.Any(prod => prod.Name == c.Name))
                {
                    listOfSubcategories.Add(new SubcategoryViewModel
                    {
                        SubcategoryID = c.SubcategoryID,
                        Name          = c.Name,
                        IsSelected    = true
                    });
                }
                else
                {
                    listOfSubcategories.Add(new SubcategoryViewModel
                    {
                        SubcategoryID = c.SubcategoryID,
                        Name          = c.Name,
                        IsSelected    = false
                    });
                }
            }

            recipe.Categories    = listOfCategories;
            recipe.Subcategories = listOfSubcategories;

            return(View(recipe));
        }