Пример #1
0
 public static void PrintSortedBooks(Catalog catalog, BookSorterByYearDelegate bookSorter, int year)
 {
     foreach (var book in catalog.GetBooksByYear(bookSorter, year))
     {
         Console.WriteLine(book);
     }
 }
Пример #2
0
 public IEnumerable <Book> GetBooksByYear(BookSorterByYearDelegate bookSorter, int year) => _books.Where(b => bookSorter(b, year));