-
Notifications
You must be signed in to change notification settings - Fork 1
Install mediator
Kirill edited this page Oct 23, 2020
·
2 revisions
services.AddMediator(mediator => mediator.RegisterPartsFromExecutingAssembly())
services.AddMediator(typeof(Class1).Assembly, typeof(Class2).Assembly)
services.AddMediator(typeof(PreProcessor), typeof(Handler))
services.AddMediator(mediator => mediator
.RegisterNotification<MyNotification>() // register pipeline if parts already registered in ServiceCollection
.RegisterRequest<MyRequest>() // register pipeline if parts already registered
.RegisterParts(partTypes) // register mediator parts from array of types
.RegisterParts(partAssemblies) // register mediator parts from array of assemblies
.AsSingleton()); // define lifetime if required (default - scoped)
Method | Mean | Error | StdDev | Ratio | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|
MediatR | 253.35 us | 3.823 us | 3.576 us | 1.00 | 48.3398 | 1.4648 | - | 298.61 KB |
Marble | 54.38 us | 0.467 us | 0.414 us | 0.21 | 4.9438 | 0.3662 | - | 30.58 KB |