public bool DeleteCar(int id) { KomodoGreen car = GetCarByModelId(id); if (_carRepo.Remove(car)) { return(true); } return(false); }
public bool UpdateCar(int id, KomodoGreen updatedCar) { KomodoGreen existingCar = GetCarByModelId(id); if (existingCar != null) { existingCar.CarType = updatedCar.CarType; existingCar.Name = updatedCar.Name; existingCar.Details = updatedCar.Details; return(true); } return(false); }
public void RemoveCarFromList(KomodoGreen carToRemove) { CarList.Remove(carToRemove); }
public void AddCar(KomodoGreen car) { car.ModelId = _modelIdCounter + 1; _carRepo.Add(car); _modelIdCounter++; }