Course · 28 lessons

LINQ in Practice

Understand execution, ordering, grouping, joins, and reliable aggregation.

  1. Deferred queries

    Observe when a query actually reads its source.

    Core ideas · 10 min
  2. Materializing a snapshot

    Choose the moment a result becomes stored data.

    Core ideas · 10 min
  3. Projecting records

    Transform each item into the shape the next step needs.

    Core ideas · 10 min
  4. Any and All

    Ask an existence question without constructing a filtered list.

    Core ideas · 10 min
  5. Ordering and tie breakers

    Make repeated report output deterministic.

    Working with data · 10 min
  6. Grouping and summaries

    Calculate one total for each category.

    Working with data · 10 min
  7. Dictionary boundaries

    Decide how duplicate keys should behave.

    Working with data · 10 min
  8. Flattening nested data

    Turn several child sequences into one stream.

    Working with data · 10 min
  9. Joining related rows

    Match records by a key rather than by position.

    Putting it together · 10 min
  10. Paging a stable sequence

    Apply a page size after deciding the ordering.

    Putting it together · 10 min
  11. Decimal aggregation

    Keep a money calculation numeric and explicit.

    Putting it together · 10 min
  12. Reusable query boundaries

    Return a stable report from a pure calculation.

    Putting it together · 10 min
  13. DistinctBy and explicit identity keys

    Remove repeated entities using a key rather than whole-object equality.

    Deeper practice · 18 min
  14. IntersectBy and ExceptBy as membership policies

    Select entities by whether their keys appear in another collection.

    Deeper practice · 18 min
  15. Chunking with a final partial batch

    Partition work while preserving every remaining element.

    Deeper practice · 18 min
  16. Zip aligns positions and stops at the shorter input

    Combine related positions while checking that their lengths satisfy the contract.

    Deeper practice · 18 min
  17. Aggregate carries an explicit accumulator

    Build a summary whose state and empty-input behavior are visible.

    Deeper practice · 18 min
  18. DefaultIfEmpty expresses an empty-sequence policy

    Choose an explicit fallback without confusing missing observations with real data.

    Deeper practice · 18 min
  19. First and Single assert different cardinalities

    Make the expected number of matching records part of the query.

    Deeper practice · 18 min
  20. Lookup indexes one-to-many relationships

    Build an index when each key can intentionally have several values.

    Deeper practice · 18 min
  21. Left joins preserve unmatched parent rows

    Represent missing related data explicitly instead of dropping the parent.

    Applied techniques · 18 min
  22. Cartesian products and multiplicative growth

    Recognize when flattening creates every combination rather than matching keys.

    Applied techniques · 18 min
  23. TakeWhile and Where ask different sequence questions

    Separate an initial valid prefix from matching elements anywhere.

    Applied techniques · 18 min
  24. Indexed query operators and original positions

    Keep source positions before a filtering step changes the sequence.

    Applied techniques · 18 min
  25. SequenceEqual checks both order and equality

    Compare ordered results with the comparer your domain requires.

    Applied techniques · 18 min
  26. Concat and Union preserve different information

    Choose between concatenating rows and constructing a set of values.

    Applied techniques · 18 min
  27. Query expressions with let bindings

    Name intermediate calculations once inside a readable query.

    Applied techniques · 18 min
  28. Ranking within independent groups

    Reset a positional rank for each partition and make tie ordering deterministic.

    Applied techniques · 18 min