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); }
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); }