public Car GetCarById(int id) { var factory = new CarsFactory(); var cars = factory.CreateCars(); return(cars.FirstOrDefault(where => where.Id == id)); }
public IList <Car> GetCarsByEngine(string engine) { var factory = new CarsFactory(); var cars = factory.CreateCars(); return(cars.Where(where => where.Engine.ToLower() == engine.ToLower()).ToList()); }
public IList <Car> GetCarsByTransmission(string transmission) { var factory = new CarsFactory(); var cars = factory.CreateCars(); return(cars.Where(where => where.Transmission.ToLower() == transmission.ToLower()).ToList()); }
public IList <Car> GetCarsByYear(int year) { var factory = new CarsFactory(); var cars = factory.CreateCars(); return(cars.Where(where => where.Year == year).ToList()); }
public IList <Car> GetCarsByModel(string model) { var factory = new CarsFactory(); var cars = factory.CreateCars(); return(cars.Where(where => where.Model.ToLower() == model.ToLower()).ToList()); }
public IList <Car> GetCars() { var factory = new CarsFactory(); return(factory.CreateCars()); }