public static void Do() { var data = new DuckData().ReadAll(); foreach (var duck in data) { duck.Display(); duck.Fly(); duck.Quack(); Console.WriteLine(); } }
public static void Do() { var duckData = new DuckData(); duckData.Write(new RubberDuck()); var ducks = duckData.ReadAll(); foreach (var duck in ducks) { duck.Display(); duck.Fly(); duck.Quack(); Console.WriteLine(); } }