예제 #1
0
        public List <Ride> GetRideList(int driver_id)
        {
            var rides = new List <Ride>();
            var ids   = InMemoryRideDataBase.GetRideIds();

            foreach (int id in ids)
            {
                var ride = InMemoryRideDataBase.GetRide(id);
                if (ride.Driver.Id == driver_id)
                {
                    rides.Add(ride);
                }
            }

            return(rides);
        }
예제 #2
0
        private List <Ride> GetRideList(int driverId)
        {
            List <Ride> rides = new List <Ride>();
            List <int>  ids   = InMemoryRideDataBase.GetRideIds();

            foreach (int id in ids)
            {
                Ride ride = InMemoryRideDataBase.GetRide(id);
                if (ride != null && ride.TaxiInfo.DriverId == driverId)
                {
                    rides.Add(ride);
                }
            }

            return(rides);
        }