Xer.Cqrs.Extensions.Microsoft.DependencyInjection

May 25, 2018 ยท View on GitHub

Extension for IServiceCollection to allow easy registration of command handlers and event handlers.

public void ConfigureServices(IServiceCollection services)
{
    // Register all CQRS components.
    services.AddCqrs(typeof(CommandHandler).Assembly, 
                     typeof(EventHandler).Assembly);
}