C#
Build games, apps, and enterprise software with C# — 67 lessons from first program to advanced .NET architecture.
A complete C# course — syntax, OOP, LINQ, collections, async and .NET fundamentals — with interactive lessons for beginners and beyond.
Part of the free C# course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.
👋 New to C#? Start here — no experience needed.
C# powers Unity games, Windows apps, and enterprise backends. Start with Lesson 1 and build from scratch.
Lessons in this course
- Introduction to C# — What C# and .NET are, and how to write and run your first program
- Variables & Data Types — int, string, bool, double — declare and use the core C# types
- Data Types — Value vs reference types, ranges, and choosing the right type
- Type Casting & Boxing — Implicit/explicit casts, Convert, and boxing/unboxing
- User Input (Console.ReadLine) — Read and parse keyboard input from the console
- Strings, Interpolation & StringBuilder — String methods, quot;interpolation", and efficient StringBuilder
- Generic Lists (List<T>) — The go-to resizable collection — add, find, sort, loop
- Dictionary (Key-Value Pairs) — Fast key-value lookups with Dictionary
- Properties & Auto-Properties — get/set, auto-properties, init and computed properties
- Enums — Named constant sets, flags, and parsing
- Checkpoint: C# Basics — Combine input, collections and strings in a build challenge — then a quiz
- Nullable Types & Null Operators — Nullable<T>, ?? , ?. and ??= for safe null handling
- Pattern Matching & Switch Expressions — Modern switch expressions, type/property patterns
- Records — Concise immutable data types with value equality and with-expressions
- Structs (struct vs class) — Value types — when to use a struct over a class
- Tuples & Deconstruction — Return multiple values and deconstruct them
- Extension Methods — Add methods to existing types without inheritance
- DateTime — Work with dates, times, spans and formatting
- Regular Expressions — Match and extract text with Regex
- Checkpoint: Types & Data — Combine records, patterns and extensions in a build challenge — then a quiz
- Operators — Arithmetic, comparison, logical, and null-coalescing operators in C#
- Control Flow — Control your program's logic with if, else, switch, and ternary expressions
- Loops — Iterate with for, foreach, while, and do-while loops
- Methods — Write reusable methods, use optional parameters, and understand scope
- Object-Oriented Programming — Create classes with properties, constructors, and encapsulation
- Inheritance & Polymorphism — Extend base classes and override methods with virtual and override
- Collections — Work with List<T>, Dictionary<K,V>, Stack, Queue, and more
- Exception Handling — Handle errors gracefully with try-catch-finally and custom exceptions
- LINQ — Query collections and databases with clean, readable LINQ expressions
- Async & Await — Write responsive, non-blocking code with async/await and Task<T>
- Delegates & Events — Build event-driven programs with delegates, Action, Func, and events
- File I/O — Read and write files, streams, and structured data with System.IO
- Advanced LINQ Queries & Optimization — GroupBy, SelectMany, deferred execution, and LINQ performance tuning
- Deep Dive Into C# Delegates & Multicast Delegates — Delegate internals, multicast chaining, and Func/Action composition
- Events: Advanced Patterns & Custom EventArgs — Custom EventArgs, weak event patterns, and event-driven architecture
- Expression Trees: Building Dynamic Logic at Runtime — Build and compile expression trees for dynamic query and code generation
- Reflection & Dynamic Type Inspection — Inspect assemblies, types, and members dynamically with the Reflection API
- Generics: Constraints, Variance & Advanced Use Cases — Type constraints, covariance, contravariance, and generic patterns
- Asynchronous Programming Internals (Tasks, Schedulers, States) — State machine compilation, SynchronizationContext, and task schedulers
- Parallel Programming with PLINQ & Parallel.For — Parallelise CPU-bound workloads safely with PLINQ and Parallel class
- Memory Management & Garbage Collector Internals — Generational GC, Large Object Heap, GC modes, and finalizers
- Unsafe Code, Span<T>, and High-Performance C# — Use Span<T>, Memory<T>, and unsafe code for zero-allocation hot paths
- IDisposable, Finalizers & Resource Management — Implement IDisposable correctly, use using declarations, and avoid leaks
- Advanced OOP Patterns (Factory, Strategy, Observer, DI) — Apply GoF patterns and DI principles in real C# applications
- Dependency Injection Internals in .NET — How .NET DI works, service lifetimes, and custom DI containers
- Logging Architecture (ILogger, Providers, Serilog) — Structured logging with ILogger, Serilog sinks, and log enrichment
- Working with Files: Streams, Buffers, Pipelines — High-performance I/O with StreamReader, BufferedStream, and System.IO.Pipelines
- Advanced JSON Processing with System.Text.Json — Serialise, deserialise, and customise JSON processing without Newtonsoft
- Building REST APIs with ASP.NET Core (Advanced) — Minimal APIs, controller patterns, model binding, and versioning
- Middleware, Filters & Custom Attributes in ASP.NET — Write custom middleware, action filters, and attributes for cross-cutting concerns
- Entity Framework Core Internals & Performance — How EF Core tracks entities, batches queries, and generates SQL
- EF Core Relationships, Tracking & Migrations Mastery — One-to-many, many-to-many, owned entities, and migration strategies
- Repository Pattern & Unit of Work (Advanced) — Implement repository and unit of work patterns in clean .NET architecture
- Authentication & Authorization with JWT (Advanced) — Issue, validate, and refresh JWTs in ASP.NET Core APIs
- Role-Based, Policy-Based & Claims-Based Security — Implement RBAC, custom policies, and claims transformation in .NET
- Caching Strategies (MemoryCache, Distributed Cache, Redis) — Add in-memory and distributed caching with IMemoryCache and Redis
- Real-Time Communication with SignalR — Build live dashboards and chat with SignalR hubs and JavaScript clients
- WebSockets & Streaming Data in .NET — Handle raw WebSocket connections and stream large data in .NET
- Unit Testing Mastery (xUnit, NUnit, MSTest) — Write clean, maintainable tests with xUnit, NUnit, and assertions
- Mocking Frameworks (Moq, NSubstitute, FakeItEasy) — Mock dependencies with Moq, set up expectations, and verify calls
- Test-Driven Development in Real Projects — Apply Red-Green-Refactor TDD to real C# feature development
- Clean Architecture in .NET (Full Deep Dive) — Layer your .NET app into Domain, Application, Infrastructure, and Presentation
- Domain-Driven Design (Aggregates, Value Objects, Repositories) — Apply DDD tactical patterns to model complex business domains in C#
- Microservices in .NET (gRPC, Messaging, Resilience) — Build .NET microservices with gRPC, MassTransit, Polly, and Docker
- Background Jobs with Hangfire & Quartz.NET — Schedule and run background tasks reliably with Hangfire and Quartz.NET
- Performance Profiling & Benchmarking (BenchmarkDotNet) — Measure and optimise .NET performance with BenchmarkDotNet and dotTrace
- Final Project — Enterprise-Grade C# Application — Build a complete enterprise-style application applying everything you've learned
- Game Development with Unity & C# — Build games with GameObjects, MonoBehaviour, prefabs and physics in Unity
- Desktop Apps with WPF & XAML — Create Windows desktop apps with XAML, data binding and the MVVM pattern
- Web UIs with Blazor — Build interactive web UIs in C# with Razor components, binding and DI
- Nullable Reference Types — Compile-time null safety with #nullable, string? and flow analysis
- Iterators with yield return — Build lazy IEnumerable<T> sequences with yield return and yield break
- Configuration & the Options Pattern — IConfiguration, appsettings binding and IOptions<T> in ASP.NET Core
- Concurrency with Channels — Producer/consumer pipelines with System.Threading.Channels and backpressure