Skip to content

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.

Steps

  1. Make sure you install Eventify with the Nuget package manager. If you are not sure how to do it please see this README file.
  2. Then register Eventify with Dependency Injection container with following line under ConfigureServices method under Startup.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.

Clone this wiki locally