public static void PrintSortedBooks(Catalog catalog, BookSorterByYearDelegate bookSorter, int year) { foreach (var book in catalog.GetBooksByYear(bookSorter, year)) { Console.WriteLine(book); } }
public IEnumerable <Book> GetBooksByYear(BookSorterByYearDelegate bookSorter, int year) => _books.Where(b => bookSorter(b, year));