Exemple #1
0
        public IActionResult Index()
        {
            var citys = _cityService.GetAll();

            var cityListing = citys.Select(c => new CityDetailModel
            {
                Id          = c.Id,
                Name        = c.Name,
                ImageUrl    = c.ImageUrl,
                ZipCode     = c.ZipCode,
                Carriers    = _carrierService.GetByCity(c),
                BusStations = _busStationService.GetByCity(c.Id)
            });

            var model = new CityIndexModel
            {
                Cities = cityListing
            };

            return(View(model));
        }