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())); }
/// <summary> /// Возвращает представление со списком кинотеатров /// </summary> public IActionResult Cinemas() { var cinemas = new CinemasViewDto { Cinemas = _cinemaService.GetAllCinemas() }; return(View(cinemas)); }
public ServiceResponse <IEnumerable <CinemaDto> > GetAllCinemas() => _cinemaService.GetAllCinemas();