Ejemplo n.º 1
0
        public ViewResult Index()
        {
            IEnumerable <TheatreDTO> theatreDTOs = theatreService.GetTheatres();
            var mapper   = new MapperConfiguration(cfg => cfg.CreateMap <TheatreDTO, TheatreViewModel>()).CreateMapper();
            var theatres = mapper.Map <IEnumerable <TheatreDTO>, List <TheatreViewModel> >(theatreDTOs);

            return(View(theatres));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> List()
        {
            var result = await _theatreService.GetTheatres();

            return(Ok(result));
        }