daily pastebin goal
20%
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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top