Exemplo n.º 1
0
        private MealsViewModel GetMealsModel()
        {
            List <Meal> items = _mealServices.GetMeals(UserId).OrderBy(x => x.Name).ToList();

            var viewModel = new MealsViewModel()
            {
                Meals = items
            };

            return(viewModel);
        }
Exemplo n.º 2
0
        private MealsTableViewModel GetMealsTableViewModel(DateTime date)
        {
            List <Meal> meals          = _mealServices.GetMeals(UserId).OrderBy(x => x.Name).ToList();
            var         mealsViewModel = Mapper.Map <IEnumerable <Meal>, IEnumerable <MealViewModel> >(meals);

            var viewModel = new MealsTableViewModel()
            {
                Meals = mealsViewModel
            };

            return(viewModel);
        }