public void RegisterCar(List <Car> cars) { foreach (var item in cars) { if (!isCarRegistered(item.NumberPlate)) { RegisteredCar.Add(item); } } }
public void RegisterCar(Car car) { if (isCarRegistered(car.NumberPlate)) { Console.WriteLine("The car is already registered!!"); return; } RegisteredCar.Add(car); Console.WriteLine($"New Car Id: {car.ID}"); }