SHARE
TWEET

Untitled

a guest Oct 18th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         }
RAW Paste Data
Top