courses / c# / level 3

level 3 · expert

advanced
c#.

Write C# like a professional: generics, delegates, LINQ, patterns, async code, thread safety and tests.

  • 28 lessons
  • 7 units
  • 5 h 38 m in all
  • £0, for good

what’s inside.

For people who build things on their own and want code that others trust and can change.

C# Level 3 is for learners who have finished Levels 1 and 2. In 28 lessons you master generics, delegates and events, LINQ in depth, iterators and extension methods, pattern matching, immutable objects, async code, cancellation, thread safety, dependency injection and testing, with a guess, a hands-on task and a fix-the-bug challenge in every lesson. It ends with a level check: a concurrent order processor, polished and tested, that you ship yourself.

every lesson goes the same way.

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

unit 1

Generics

Write code once that works safely with any type.

4 lessons · 47 min

  1. One box, any type11 minWrite a class once and let it hold any type, checked by the compiler.
  2. Generic methods11 minWrite one method that works with lists of anything.
  3. Constraints12 minPromise C# what a type can do, then use it.
  4. A generic repository13 minBuild one store that keeps and finds any kind of item by id.

unit 2

Delegates and events

Pass behaviour around like any other value.

4 lessons · 46 min

  1. Delegates11 minStore a method in a variable and swap it for another.
  2. Func and Action11 minUse the delegate types C# already ships instead of writing your own.
  3. Closures12 minMake lambdas that remember values from the code around them.
  4. Events12 minLet an object announce news to any number of listeners.

unit 3

LINQ in depth

Ask big questions of your data in a few clear lines.

4 lessons · 49 min

  1. Deferred execution12 minKnow exactly when a LINQ query does its work.
  2. GroupBy12 minSort data into labelled groups and summarise each one.
  3. Join12 minMatch up items from two lists that share an id.
  4. SelectMany and Aggregate13 minFlatten lists of lists, and fold a sequence into one answer.

unit 4

Sequences and extensions

Make your own lazy sequences and add commands to any type.

4 lessons · 48 min

  1. Iterators12 minWrite methods that hand out items one at a time with yield return.
  2. Lazy and infinite12 minWork safely with sequences that never end.
  3. Extension methods11 minAdd your own methods to types you cannot edit, like string.
  4. Your own LINQ operator13 minCombine generics, extensions and yield into operators that chain with LINQ.

unit 5

Patterns and records

Describe the shape of your data and keep it from changing.

4 lessons · 48 min

  1. Switch expressions11 minTurn a value into an answer in a few tidy lines.
  2. Relational and logical patterns12 minMatch ranges of values with <, >=, and, or and not.
  3. Type and property patterns13 minCheck what an object is and what is inside it, in one arm.
  4. Immutable objects12 minBuild objects that nobody can change behind your back.

unit 6

Async and threads

Wait for slow work without freezing, and run work side by side.

4 lessons · 50 min

  1. async and await12 minWait for slow work without freezing your program.
  2. Task.WhenAll12 minRun several slow jobs at the same time and collect every answer.
  3. Cancellation13 minStop slow work cleanly when the user or a time limit says so.
  4. Threads and locks13 minRun work on several threads and keep a shared total correct.

unit 7

Safe and tested

Share data between threads safely, and prove your code works.

4 lessons · 50 min

  1. Interlocked12 minUpdate a shared number safely without a lock.
  2. ConcurrentDictionary12 minLet many threads add to one dictionary without losing a count.
  3. Dependency injection13 minPass a class the helpers it needs, so you can test it with fakes.
  4. Your own assertions13 minWrite tiny tests that prove your code works, edge cases included.
end of level 3 level check: a concurrent order processor Build one small project with everything from this level. Pass it and your face levels up. see the check

finished c#?

pick your next language.

see all courses