Рет қаралды 23,565
☄️ Master the Modular Monolith Architecture: bit.ly/3SXlzSt
📌 Accelerate your Clean Architecture skills: bit.ly/3PupkOJ
🚀 Support me on Patreon to access the source code: / milanjovanovic
Scalability is important. And domain events can help you build a scalable system by allowing you to achieve a decoupled architecture. I'll show you how to use domain events and discuss the pros and cons of publishing domain events with EF Core.
Join my weekly .NET newsletter:
www.milanjovan...
Read my Blog here:
www.milanjovan...
Subscribe for more:
/ @milanjovanovictech
Chapters
0:00 The problem of coupling
0:43 Creating a DomainEvent base class
1:44 Adding the OrderCreatedDomainEvent
3:01 Adding the LineItemRemovedDomainEvent
3:50 Domain events naming convention
4:13 Entity class for raising domain events
5:14 Raising domain events in Order entity
6:27 Handling domain events with MediatR
9:11 How are we going to publish domain events?
11:09 Decision: Publishing BEFORE or AFTER persisting changes?
12:22 Publishing domain events with IPublisher