public async Task <ParkingLot> GetParkingLot(string code)
        {
            var parkingLotData = _context.ParkingLots.FirstOrDefault(x => x.Code == code);
            var occupiedSpace  = _context.ParkedCars.Count();
            var parkingLot     = ParkingLotAdapter
                                 .Create(parkingLotData.Code, parkingLotData.Capacity,
                                         parkingLotData.OpenHour, parkingLotData.CloseHour, occupiedSpace);

            return(parkingLot);
        }
예제 #2
0
        public async Task <ParkingLot> GetParkingLot(string code)
        {
            parkingLots.Add(new ParkingLot("shopping", 5, 8, 22, 0));
            parkingLots.Add(new ParkingLot("drugstore", 5, 7, 19, 0));

            var parkingLotData = parkingLots.Find(x => x.Code == code);
            var occupiedSpace  = parkedCars.Count;
            var parkingLot     = ParkingLotAdapter
                                 .Create(parkingLotData.Code, parkingLotData.Capacity,
                                         parkingLotData.OpenHour, parkingLotData.CloseHour, occupiedSpace);

            return(parkingLot);
        }