vc-platform icon indicating copy to clipboard operation
vc-platform copied to clipboard

VCST-430: Simplify event handlers registration

Open artem-dudarev opened this issue 11 months ago • 1 comments

Description

Before

var handlerRegistrar = appBuilder.ApplicationServices.GetService<IHandlerRegistrar>();
handlerRegistrar.RegisterHandler<UserChangedEvent>(async (message, token) => await appBuilder.ApplicationServices.GetService<LogChangesUserChangedEventHandler>().Handle(message));

After

appBuilder.RegisterEventHandler<UserChangedEvent, LogChangesUserChangedEventHandler>();

Also, now it's possible to register a handler for all event types:

appBuilder.RegisterEventHandler<DomainEvent, AllEventsHandler>();

References

QA-test:

Jira-link:

https://virtocommerce.atlassian.net/browse/VCST-430

Artifact URL:

artem-dudarev avatar Mar 04 '24 16:03 artem-dudarev