var services = new ServiceCollection();
services.AddEvents();If you don't wish to use the default In-Memory bus, you can specify a different bus via IEventsBuilder
var services = new ServiceCollection();
services.AddEvents()
.UseBus<RedisBus>();The SimpleEventService is a basic class which does basic handling and publishing of events. This can be used without having to worry about using Dependency Injection or building your own event service
var eventService = new SimpleEventService();
eventService.RegisterHandler<ExampleEvent>(evt =>
{
Console.WriteLine("Hello!");
return Task.CompletedTask;
});
await eventService.PublishAsync(new ExampleEvent());