-
Notifications
You must be signed in to change notification settings - Fork 1
Eventify integration with ASP.NET Core
Shreyas Jejurkar edited this page Aug 23, 2020
·
1 revision
Eventify target .NET core as a runtime to work. We will see how we can use Eventify with ASP.NET Core.
- Make sure you install Eventify with the Nuget package manager. If you are not sure how to do it please see this README file.
- Then register Eventify with Dependency Injection container with following line under
ConfigureServices
method underStartup.cs
.
services.AddEventify(Assembly.GetExecutingAssembly());
The above line will register all the events (implemented from Event
abstract class) and their corresponding event handlers (IEventHandler<T>
) to DI container. AddEventiy
takes an array of assemblies, then the handlers found in those assemblies will be registered to DI container. Along with this, it will also register the implementation of InMemory event dispatcher of the abstraction IEventPublisher
DI container to dispatch the events.