Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string GetBooksByPrice(BookShopContext db)
- {
- var booksByPrice = db.Books
- .OrderByDescending(b => b.Price)
- .Where(b => b.Price > 40)
- .Select(b => $"{b.Title} - ${b.Price}")
- .ToList();
- var result = String.Join(Environment.NewLine, booksByPrice);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement