Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

EventBus injection best practice #10091


User avatar
0
lweng567 created

What is your product version? 9.3.0 What is your product type (Angular or MVC)? Angular What is product framework type (.net framework or .net core)? .net Core If issue related with ABP Framework What is ABP Framework version? Zero

Hi,

I am seeking some advise regarding the Domain events. An example in your documentation (TaskAppService), IEventBus was injected to the application service layer. If I look at the sample EventCloud project, the IEventBus was injected in Domain Layer (EventManager), can you please advise what should be the best place or best practice to inject the IEventBus?

thanks


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @lweng567

    It is better to use these events in domain services but most of the time you might not need to create a domain service for your use cases. In that case, you can use them in app services as well. But, we suggest domain services.