Query and transform data with C# LINQ

8 steps · about 3 h 40 min · Intermediate

  1. See the LINQ workflow (guide, Microsoft Learn, 30 min)

    Connect data sources, query operators and strongly typed results in one model.

  2. Write a first query (guide, Microsoft Learn, 30 min)

    Create a small sequence and express selection with query or method syntax.

  3. Filter records (reference, Microsoft Learn, 20 min)

    Keep only elements that satisfy a clear predicate.

  4. Project a result shape (reference, Microsoft Learn, 25 min)

    Transform source objects into the exact fields needed downstream.

  5. Order results predictably (guide, Microsoft Learn, 25 min)

    Apply primary and secondary keys without mutating the source collection.

  6. Group related values (guide, Microsoft Learn, 30 min)

    Partition records by a meaningful key before summarising them.

  7. Calculate aggregates (reference, Microsoft Learn, 25 min)

    Compute counts, totals and averages with explicit empty-sequence behaviour.

  8. Control when the query runs (guide, Microsoft Learn, 35 min)

    Explain deferred execution, materialise deliberately and avoid accidental repeated work.