Загрузка...

Building a Custom Domain Events Dispatcher in .NET

Get the free Clean Architecture template: https://dub.sh/ca-template
Want to master Clean Architecture? Go here: https://bit.ly/3PupkOJ
Want to unlock Modular Monoliths? Go here: https://bit.ly/3SXlzSt
Get the source code here: https://www.patreon.com/milanjovanovic

Thinking of removing MediatR from your .NET application?

In this video, I show you how I built a custom domain event dispatcher to replace MediatR’s IPublisher.Publish functionality — without breaking my application layer.

You’ll learn:
- How MediatR handles domain events under the hood
- How to define IDomainEvent and IDomainEventHandler interfaces
- Wiring up the dispatcher with EF Core and SaveChangesAsync
- Using reflection and scoped DI to invoke handlers
- Trade-offs (performance, type safety, complexity)

Whether you're building a Clean Architecture app or want more control over your CQRS stack — this guide will help you move away from third-party dependencies like MediatR.

Check out my courses:
https://www.milanjovanovic.tech/courses

Read my Blog here:
https://www.milanjovanovic.tech/blog

Join my weekly .NET newsletter:
https://www.milanjovanovic.tech

Chapters
0:00 How Domain Events Work
2:42 Creating IDomainEventHandler
4:37 Adding Handlers in DI
6:47 Creating DomainEventsDispatcher
13:51 Testing the Implementation

Видео Building a Custom Domain Events Dispatcher in .NET канала Milan Jovanović
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять