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.
- meet it
- guess first
- your turn
- fix it
- nailed it
unit 1
Generics
Write code once that works safely with any type.
- One box, any type11 minWrite a class once and let it hold any type, checked by the compiler.
- Generic methods11 minWrite one method that works with lists of anything.
- Constraints12 minPromise C# what a type can do, then use it.
- 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.
- Delegates11 minStore a method in a variable and swap it for another.
- Func and Action11 minUse the delegate types C# already ships instead of writing your own.
- Closures12 minMake lambdas that remember values from the code around them.
- 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.
unit 4
Sequences and extensions
Make your own lazy sequences and add commands to any type.
- Iterators12 minWrite methods that hand out items one at a time with
yield return. - Lazy and infinite12 minWork safely with sequences that never end.
- Extension methods11 minAdd your own methods to types you cannot edit, like
string. - Your own LINQ operator13 minCombine generics, extensions and
yieldinto operators that chain with LINQ.
unit 5
Patterns and records
Describe the shape of your data and keep it from changing.
- Switch expressions11 minTurn a value into an answer in a few tidy lines.
- Relational and logical patterns12 minMatch ranges of values with
<,>=,and,orandnot. - Type and property patterns13 minCheck what an object is and what is inside it, in one arm.
- 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.
- async and await12 minWait for slow work without freezing your program.
- Task.WhenAll12 minRun several slow jobs at the same time and collect every answer.
- Cancellation13 minStop slow work cleanly when the user or a time limit says so.
- 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.
- Interlocked12 minUpdate a shared number safely without a lock.
- ConcurrentDictionary12 minLet many threads add to one dictionary without losing a count.
- Dependency injection13 minPass a class the helpers it needs, so you can test it with fakes.
- Your own assertions13 minWrite tiny tests that prove your code works, edge cases included.