Examples from Chapter 10 (LINQ) of Programming C# 12.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. Query with an infinite source sequence
- Example 9. A custom deferred Where operator
- Example 10. Accidental reevaluation of a deferred query
- Example 14. Where operator with index
- Example 15. The OfType<T> operator
- Example 16. Removing duplicates with Distinct
- Example 17. Select operator with index
- Example 18. Indexed Select downstream of Where operator
- Example 19. Indexed Select upstream of Where operator
- Example 20. Fetching more data than is needed
- Example 21. A select clause with an anonymous type
- Example 22. Using Select to transform numbers
- Example 23. Using SelectMany from a query expression
- Example 24. SelectMany operator
- Example 25. Flattening a jagged array
- Example 26. SelectMany without item projection
- Example 27. One implementation of SelectMany
- Example 28. Query expression with orderby clause
- Example 29. How not to apply multiple ordering criteria
- Example 30. Multiple ordering criteria in a query expression
- Example 31. Multiple ordering criteria with LINQ operators
- Example 32. Applying the Single operator to a query
- Example 33. Single operator with predicate
- Example 34. Using First to select the longest course
- Example 35. SingleOrDefault with explicit default value
- Example 36. How not to use ElementAt
- Example 37. Average operator with projection
- Example 38. Max with projection
- Example 39. MaxBy with projection for criteria but not for result
- Example 40. MaxBy with projection for criteria but not for result with error on empty input
- 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 47. Grouping query expression
- Example 48. Expanding a simple grouping query
- Example 49. Group query with item projection
- Example 50. Expanding a group query with an item projection
- Example 51. Group query with group projection
- Example 52. Expanded group query with group projection
- Example 53. GroupBy with key and group projections
- Example 54. GroupBy operator with key, item, and group projections
- Example 55. Composite group key