← All tutorials

Skill Zuno · skillzunos.com · Fullstack

C# Design Patterns tutorial

Learn C# Design Patterns on Skill Zuno. This C# Design Patterns tutorial covers New, Easy, Medium, Hard, and Diff levels so you can study practical C# Design Patterns problems on skillzunos.com.

Open C# Design Patterns on Skill Zuno

Also see the C# Design Patterns interview questions.

Design patterns in C# build on interfaces, generics, delegates, events and the dependency injection built into .NET. Some classic patterns are part of the language itself: observer through events, iterator through IEnumerable and yield, and decorator through middleware. Interviews cover Gang of Four patterns, SOLID, DI and patterns used in ASP.NET Core.

C# Design Patterns topics covered

  • Dependency injection and inversion of control in .NET — Wiring dependencies through the built-in container instead of creating them inside classes.
  • Repository and unit of work with Entity Framework Core — Abstracting data access, and when DbContext is already enough.
  • Strategy with interfaces and delegates — Choosing an algorithm at runtime using interfaces or Func delegates.
  • Observer with events and IObservable — Notifying subscribers with C# events or reactive streams.
  • Iterator with IEnumerable and yield return — Producing sequences lazily with compiler-generated iterators.
  • Decorator and the ASP.NET Core middleware pipeline — Adding behaviour by wrapping objects, as ASP.NET Core does with middleware.
  • Factory, builder and the options pattern — Creating complex objects step by step, and configuring them through IOptions.
  • Mediator and CQRS — Decoupling request senders from handlers and separating reads from writes.

What you can learn

  • C# Design Patterns tutorial for beginners and experienced developers
  • Level-based practice: New, Easy, Medium, Hard, and Diff
  • Fullstack topics alongside C# Design Patterns on skillzunos.com

More Fullstack tutorials

All tutorials