예제 #1
0
        // GET: Menu/Create
        public ActionResult Create()
        {
            var newMenu = new MenuCreateViewModel();
            var recipeModelsDropdownList     = _recipeManager.GetAll();
            var recipeViewModelsDropdownList = _mapper.Map <List <RecipeViewModel> >(recipeModelsDropdownList);

            newMenu.RecipeViewModelsDropdownList = recipeViewModelsDropdownList;

            newMenu.Days = _mapper.Map <List <DayViewModel> >(_dayManager.GetAll());

            return(View(newMenu));
        }
예제 #2
0
        // GET: Recipe
        public ActionResult Index()
        {
            var recipeList = _recipeManager.GetAll();
            var listOfIngredientsViewModels = _mapper.Map <IList <RecipeViewModel> >(recipeList);

            return(View(listOfIngredientsViewModels));
        }