public ServiceResponse <IEnumerable <CinemaDto> > GetAllCinemas()
        {
            _logger.LogInformation($"Вход в метод CinemaService.GetAllCinemas");
            return(Execute(() =>
            {
                var cinemas = _cinemaRepository.GetAllCinemas();

                var listCinemaDtos = cinemas.Select(cinema => new CinemaDto(cinema));
                return ServiceResponse <IEnumerable <CinemaDto> > .Ok(listCinemaDtos);
            }));
        }
Esempio n. 2
0
 public async Task <ActionResult <IEnumerable <Cinema> > > GetCinemas()
 {
     return(Ok(await _cinemaRepository.GetAllCinemas(User)));
 }