Skip to content

Commit

Permalink
Fix eventHandlerRegistrar code (#2196)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei Kolchanov <akak1977@users.noreply.github.com>
  • Loading branch information
OlegoO and akak1977 committed Apr 5, 2021
1 parent 46467b6 commit a990fc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/fundamentals/extensibility/extending-using-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ void Initialize(IServiceCollection serviceCollection)
void PostInitialize(IApplicationBuilder appBuilder)
{
...
var eventHandlerRegistrar = appBuilder.ServiceCollection.Resolve<IHandlerRegistrar>();
eventHandlerRegistrar.RegisterHandler<CustomDomainEvent>(async (message, token) => await _container.Resolve<CustomDomainEventHandler>().Handle(message));
var eventHandlerRegistrar = appBuilder.ApplicationServices.GetService<IHandlerRegistrar>();
eventHandlerRegistrar.RegisterHandler<CustomDomainEvent>((message, token) => appBuilder.ApplicationServices.GetService<CustomDomainEventHandler>().Handle(message));
...
}
```
Expand Down

0 comments on commit a990fc6

Please sign in to comment.