public List <CarStatus> SearchBy(string key) { List <Car> foundCars = RegisteredCar.FindAll(rcar => rcar.NumberPlate.ToLower() == key.ToLower()); List <CarStatus> carStatus = new List <CarStatus>(); CarStatus cs; foreach (var car in foundCars) { cs = new CarStatus(); cs.car = car; cs.checkInStatus = isCarCheckedIn(car.ID); carStatus.Add(cs); } return(carStatus); }
public List <Car> getAllCheckedInCars() { return(RegisteredCar.FindAll(rcar => CheckedInCar.Contains(rcar.ID))); }