예제 #1
0
 public void RegisterCar(List <Car> cars)
 {
     foreach (var item in cars)
     {
         if (!isCarRegistered(item.NumberPlate))
         {
             RegisteredCar.Add(item);
         }
     }
 }
예제 #2
0
 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}");
 }