Course · 31 lessons

Collections & LINQ

Filter, project, and add up decimal values.

  1. Lists of values

    A list is a sequence you can walk from the first item to the last.

    Collections · 8 min
  2. Looking up

    An index reads one item. It does not change the list.

    Collections · 8 min
  3. Walking items

    foreach visits every item once, in order.

    Collections · 8 min
  4. Filter and sum

    Where keeps matching items. Sum adds their values.

    LINQ · 8 min
  5. Project a field

    Select turns each item into the value you want to add.

    LINQ · 8 min
  6. Sort

    OrderBy changes the sequence you read. It does not rewrite the array.

    LINQ · 8 min
  7. Group

    GroupBy gathers rows that share a key.

    LINQ · 8 min
  8. Count

    Count tells you how many items matched. It does not add their amounts.

    LINQ · 8 min
  9. Empty sequences

    A filter that keeps nothing has a sum of 0.

    LINQ · 8 min
  10. Deferred work

    Where describes the filter. Sum is what walks it.

    LINQ · 8 min
  11. Several queries

    Two Where calls can disagree. Read each one.

    LINQ · 8 min
  12. Decimal totals

    Money stays in decimal, so 0.10 plus 0.20 is 0.30.

    LINQ · 8 min
  13. Paid and unpaid

    A bool decides which rows enter the total.

    LINQ · 8 min
  14. Refunds

    A negative paid amount is still part of the sum.

    LINQ · 8 min
  15. Your own project

    Open in Code keeps a copy the course cannot overwrite.

    LINQ · 8 min
  16. Hash sets for membership checks

    Choose a set when the question is whether an item is already present.

    Collection techniques · 15 min
  17. Set operations for reconciliation

    Find shared, missing, and combined identifiers between two batches.

    Collection techniques · 15 min
  18. Queues and first-in, first-out work

    Process a small work list in the same order it was accepted.

    Collection techniques · 15 min
  19. Stacks and last-in, first-out history

    Reverse a sequence of actions with a deliberately limited undo model.

    Collection techniques · 15 min
  20. Frequency maps with dictionaries

    Count repeated categories without scanning the whole collection for every item.

    Collection techniques · 15 min
  21. Deterministic reports from dictionaries

    Separate lookup structure from the ordering required by a report.

    Collection techniques · 15 min
  22. Equality rules that follow the identifier

    Apply one comparer consistently across deduplication, lookup, and grouping.

    Collection techniques · 15 min
  23. Removing selected list items safely

    Use a predicate-based bulk removal instead of mutating a foreach traversal.

    Collection techniques · 15 min
  24. Binary search and insertion positions

    Interpret both the found and not-found results of a sorted-list search.

    Collection techniques · 15 min
  25. Jagged arrays and per-row contracts

    Process rows with different lengths without assuming a rectangular grid.

    Collection techniques · 15 min
  26. SelectMany while retaining parent context

    Flatten nested values without losing the group each value came from.

    Collection techniques · 15 min
  27. Zip and the contract for paired sequences

    Combine values by position while checking whether unmatched tails are acceptable.

    Collection techniques · 15 min
  28. Joins and one-to-many matches

    Predict the number of report rows before joining two keyed collections.

    Collection techniques · 15 min
  29. Lookups for repeated group access

    Build a one-to-many index when the same grouping will be queried several times.

    Collection techniques · 15 min
  30. Aggregate with an explicit seed

    Describe a fold whose initial state also defines the empty-input result.

    Collection techniques · 15 min
  31. Read-only views and stable snapshots

    Distinguish restricted access from independently frozen collection contents.

    Collection techniques · 15 min