Examples from Chapter 10 (LINQ) of Programming C# 8.0 (O'Reilly).
- Example 1. A LINQ query expression
- Example 2. The non-LINQ equivalent
- Example 3. Extracting just one property in a query
- Example 4. The effect of a query expression
- Example 5. How trivial select clauses expand
- Example 6. Query with a let clause
- Example 7. How multivariable query expressions expand (approximately)
- Example 8. Nonsensical Where and Select
- Example 9. A meaningless query
- Example 10. How the compiler transforms the meaningless query
- Example 11. A custom LINQ provider for CultureInfo[]
- Example 12. Query with an infinite source sequence
- Example 13. A custom deferred Where operator
- Example 14. Accidental reevaluation of a deferred query
- Example 20. Select operator with index
- Example 21. Indexed Select downstream of Where operator
- Example 22. Indexed Select upstream of Where operator
- Example 23. Fetching more data than is needed
- Example 24. A select clause with an anonymous type
- Example 25. Using Select to transform numbers
- Example 26. Using SelectMany from a query expression
- Example 27. SelectMany operator
- Example 28. Flattening a jagged array
- Example 29. SelectMany without item projection
- Example 30. One implementation of SelectMany
- Example 31. Query expression with orderby clause
- Example 32. How not to apply multiple ordering criteria
- Example 33. Multiple ordering criteria in a query expression
- Example 34. Multiple ordering criteria with LINQ operators
- Example 35. Applying the Single operator to a query
- Example 36. Single operator with predicate
- Example 37. Using First to select the longest course
- Example 38. How not to use ElementAt
- Example 39. Average operator with projection
- Example 40. Max with projection
- Example 41. Sum and equivalent with Aggregate
- Example 42. Implementing Max with Aggregate
- Example 43. Implementing Average with Aggregate
- Example 44. Aggregating bounding boxes
- Example 45. More verbose and less obscure bounding box aggregation
- Example 46. The effect of Aggregate
- Example 49. Grouping query expression
- Example 50. Expanding a simple grouping query
- Example 51. Group query with item projection
- Example 52. Expanding a group query with an item projection
- Example 53. Group query with group projection
- Example 54. Expanded group query with group projection
- Example 55. GroupBy with key and group projections
- Example 56. GroupBy operator with key, item, and group projections
- Example 57. Composite group key