ChrisMissal / MediatR.Extensions.Microsoft.DependencyInjection

MediatR extensions for Microsoft.Extensions.DependencyInjection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MediatR extensions for Microsoft.Extensions.DependencyInjection

Scans assemblies and adds handlers, preprocessors, and postprocessors implementations to the container. To use, with an IServiceCollection instance:

services.AddMediatR(typeof(MyHandler));

or with an assembly:

services.AddMediatR(typeof(Startup).GetTypeInfo().Assembly);

Supports generic variance of handlers.

To customize registration, such as lifecycle or the registration type:

services.AddMediatR(cfg => cfg.Using<MyCustomMediator>().AsSingleton(), typeof(Startup));

To register behaviors, pre- or post-processors, register them individually before or after calling AddMediatR.

About

MediatR extensions for Microsoft.Extensions.DependencyInjection

License:MIT License


Languages

Language:C# 96.2%Language:PowerShell 3.8%