public IEnumerable <Trip> FindPassengersTrips(string passengerId) { HashSet <string> tripIds = new HashSet <string>(); foreach (Passenger p in PassengersList) { if (p.UserId == passengerId) { tripIds.Add(p.TripId); } } return(TripsList .Where(x => tripIds.Contains(x.Id))); }
public IEnumerable <Trip> FindTripBySh(string userSh) { return(TripsList .Where(t => t.DriverId == userSh));; }
public IEnumerable <Trip> FindTrip(string from, string to, DateTime date) { return(TripsList .Where(t => t.From == from && t.To == to && t.Date.Date == date.Date)); }
public Trip FindTrip(string id) { return(TripsList.FirstOrDefault(t => t.Id == id)); }