Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public static void PrintBooksByAuthorAndTotalPrice(Library library)
  2. {
  3.  
  4. foreach (var book in library.Books
  5. .GroupBy(b => b.Autor)
  6. .OrderByDescending(x => x.Sum(p => p.Price))
  7. .ThenBy(k => k.Key))
  8. {
  9. Console.WriteLine($"{book.Key} -> {book.Sum(p => p.Price):f2}");
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement