public IEnumerable <Car> Search(string searchType, string user, int minYear = 2000, int maxYear = 2100)
        {
            ModelMockRepo     modelRepo = new ModelMockRepo();
            MakeMockRepo      makeRepo  = new MakeMockRepo();
            IEnumerable <Car> vehicles  = new List <Car>();

            vehicles = GetAllCars().Where(c => c.isSold == true);


            return(vehicles);
        }
        public IEnumerable <Car> Search(string searchType, string searchText, decimal minPrice = 0, decimal maxPrice = 900000000, int minYear = 2000, int maxYear = 2100)
        {
            ModelMockRepo     modelRepo = new ModelMockRepo();
            MakeMockRepo      makeRepo  = new MakeMockRepo();
            IEnumerable <Car> vehicles  = new List <Car>();

            switch (searchType)
            {
            case "New":
            case "Used":
                vehicles = GetAllCars().Where(c => c.Type == searchType).Where(c => c.isSold == false);
                break;

            case "All":
                vehicles = GetAllCars().Where(c => c.isSold == false);
                break;

            default:
                break;
            }

            List <Car> found = new List <Car>();

            int year = 0;

            int.TryParse(searchText, out year);

            foreach (var car in vehicles)
            {
                car.Make  = makeRepo.GetById(car.MakeId);
                car.Model = modelRepo.GetById(car.ModelId);

                if (car.Year >= minYear && car.Year <= maxYear && car.Price >= minPrice && car.Price <= maxPrice)
                {
                    if (searchText != "hamster")
                    {
                        if (car.Year == year || car.Make.MakeName.ToLower().Contains(searchText.ToLower()) || car.Model.ModelName.ToLower().Contains(searchText.ToLower()))
                        {
                            found.Add(car);
                        }
                    }
                    else
                    {
                        found.Add(car);
                    }
                }
            }

            return(found);
        }
        public IEnumerable <Car> Search(string searchType, string user, int minYear = 2000, int maxYear = 2100)
        {
            ModelMockRepo     modelRepo = new ModelMockRepo();
            MakeMockRepo      makeRepo  = new MakeMockRepo();
            IEnumerable <Car> vehicles  = new List <Car>();

            switch (searchType)
            {
            case "All":
                vehicles = GetAllCars().Where(c => c.isSold == true);
                break;

            default:
                break;
            }

            List <Car> found = new List <Car>();

            return(found);
        }