DEV Community

Wahid Bitar
Wahid Bitar

Posted on

Answer: Accessing ASP.NET Core DI Container From Static Factory Class

I know my answer is late, but I wanted to share how I did it.

First of all: It's Antipattern to use ServiceLocator so try not to use it as you can In my case I needed it to call MediatR inside of my DomainModel to implement the DomainEvents

Top comments (0)