Browse Source

#4768 add UOW information to the local event bus too.

pull/5011/head
Halil İbrahim Kalkan 6 years ago
parent
commit
4b966b14f3
  1. 2
      docs/en/Local-Event-Bus.md

2
docs/en/Local-Event-Bus.md

@ -154,6 +154,8 @@ That's all. `MyHandler` is **automatically discovered** by the ABP Framework and
* **Zero or more handlers** can subscribe to the same event. * **Zero or more handlers** can subscribe to the same event.
* A single event handler class can **subscribe to multiple events** but implementing the `ILocalEventHandler<TEvent>` interface for each event type. * A single event handler class can **subscribe to multiple events** but implementing the `ILocalEventHandler<TEvent>` interface for each event type.
If you perform **database operations** and use the [repositories](Repositories.md) inside the event handler, you may need to create a [unit of work](Unit-Of-Work.md), because some repository methods need to work inside an **active unit of work**. Make the handle method `virtual` and add a `[UnitOfWork]` attribute for the method, or manually use the `IUnitOfWorkManager` to create a unit of work scope.
> The handler class must be registered to the dependency injection (DI). The sample above uses the `ITransientDependency` to accomplish it. See the [DI document](Dependency-Injection.md) for more options. > The handler class must be registered to the dependency injection (DI). The sample above uses the `ITransientDependency` to accomplish it. See the [DI document](Dependency-Injection.md) for more options.
## Transaction & Exception Behavior ## Transaction & Exception Behavior

Loading…
Cancel
Save