예제 #1
0
 public void Replace(int index, CarDTO car)
 {
     if (IsCorrect(car) && IsInBounds(index))
     {
         Directory[index] = car;
         return;
     }
     throw new ArgumentException();
 }
예제 #2
0
 public void Add(CarDTO car)
 {
     if (IsCorrect(car))
     {
         Directory.Add(car);
         return;
     }
     throw new ArgumentException();
 }
예제 #3
0
 private bool IsCorrect(CarDTO car)
 {
     return(car.Manufacturer != null && car.Model != null);
 }