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