public IActionResult Index()
        {
            var listOfAllCinemas = _cinemaService.GetAllCinemas();

            foreach (var item in listOfAllCinemas)
            {
                var newdescription = item.CinemaDescription.Length <= 20 ? item.CinemaDescription : item.CinemaDescription.Substring(0, 20) + "...";
                item.CinemaDescription = newdescription;
            }

            return(View(listOfAllCinemas.ToList()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Возвращает представление со списком кинотеатров
        /// </summary>
        public IActionResult Cinemas()
        {
            var cinemas = new CinemasViewDto
            {
                Cinemas = _cinemaService.GetAllCinemas()
            };

            return(View(cinemas));
        }
 public ServiceResponse <IEnumerable <CinemaDto> > GetAllCinemas() => _cinemaService.GetAllCinemas();