コード例 #1
0
        public static void Do()
        {
            var data = new DuckData().ReadAll();

            foreach (var duck in data)
            {
                duck.Display();
                duck.Fly();
                duck.Quack();
                Console.WriteLine();
            }
        }
コード例 #2
0
        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();
            }
        }