Esempio n. 1
0
        public Car GetCarById(int id)
        {
            var factory = new CarsFactory();
            var cars    = factory.CreateCars();

            return(cars.FirstOrDefault(where => where.Id == id));
        }
Esempio n. 2
0
        public IList <Car> GetCarsByEngine(string engine)
        {
            var factory = new CarsFactory();
            var cars    = factory.CreateCars();

            return(cars.Where(where => where.Engine.ToLower() == engine.ToLower()).ToList());
        }
Esempio n. 3
0
        public IList <Car> GetCarsByTransmission(string transmission)
        {
            var factory = new CarsFactory();
            var cars    = factory.CreateCars();

            return(cars.Where(where => where.Transmission.ToLower() == transmission.ToLower()).ToList());
        }
Esempio n. 4
0
        public IList <Car> GetCarsByYear(int year)
        {
            var factory = new CarsFactory();
            var cars    = factory.CreateCars();

            return(cars.Where(where => where.Year == year).ToList());
        }
Esempio n. 5
0
        public IList <Car> GetCarsByModel(string model)
        {
            var factory = new CarsFactory();
            var cars    = factory.CreateCars();

            return(cars.Where(where => where.Model.ToLower() == model.ToLower()).ToList());
        }
Esempio n. 6
0
        public IList <Car> GetCars()
        {
            var factory = new CarsFactory();

            return(factory.CreateCars());
        }