public IActionResult Index() { ViewData["Title"] = "Herbaty"; var teas = _teaRepository.GetAllTeas(); var model = _mapper.Map <IEnumerable <Tea>, IEnumerable <TeaViewModel> >(teas); return(View(model)); }
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)); }