Beispiel #1
0
        public IActionResult Index()
        {
            ViewData["Title"] = "Herbaty";
            var teas  = _teaRepository.GetAllTeas();
            var model = _mapper.Map <IEnumerable <Tea>, IEnumerable <TeaViewModel> >(teas);

            return(View(model));
        }
Beispiel #2
0
        public IActionResult Products(string messageOk, string messageBad)
        {
            ViewData["StatusMessageOk"]  = messageOk;
            ViewData["StatusMessageBad"] = messageBad;

            var teas  = _teaRepository.GetAllTeas();
            var model = _mapper.Map <IEnumerable <Tea>, IEnumerable <TeaViewModel> >(teas);

            return(View(model));
        }