public IActionResult Index() { var model = new MoviesViewModel { Movies = _movieRepository.List().Include(schedule => schedule.Movie).ToList(), Cities = _citiesRepository.List().Include(city => city.Cinemas).ToList() }; return(View(model)); }
public List <City> List(string country) { try { List <City> cities = _citiesRepository.List(country); return(cities); } catch (NullReferenceException) { throw new NotFoundException("Cities were not found!"); } catch (MySqlException) { throw new ConnectionException(); } }