예제 #1
0
        public static void Main()
        {
            var books = new BooksCollection();

            books.Add(new Book {
                Title = "Musk"
            });
            books.Add(new Book {
                Title = "Mars"
            });
            books.Add(new Book {
                Title = "Tesla"
            });
            books.Add(new Book {
                Title = "SpaceX"
            });
            books.Add(new Book {
                Title = "Solar"
            });

            foreach (var book in books)
            {
                Console.WriteLine(book.Title);
            }

            foreach (var number in GetSome())
            {
                Console.WriteLine(number);
            }
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var books = new BooksCollection();

            books.Add(new Book {
                Title = "Gosho"
            });
            books.Add(new Book {
                Title = "Petyo"
            });
            books.Add(new Book {
                Title = "Stamat"
            });
            foreach (var book in books)
            {
                System.Console.WriteLine(book.Title);
            }
        }