Medici 1.0.1
dotnet add package Medici --version 1.0.1
NuGet\Install-Package Medici -Version 1.0.1
<PackageReference Include="Medici" Version="1.0.1" />
<PackageVersion Include="Medici" Version="1.0.1" />
<PackageReference Include="Medici" />
paket add Medici --version 1.0.1
#r "nuget: Medici, 1.0.1"
#:package Medici@1.0.1
#addin nuget:?package=Medici&version=1.0.1
#tool nuget:?package=Medici&version=1.0.1
Medici
Just another simple mediator implementation library.
How to use it?
First you need to install the according packages from NuGet:
Medici.Abstractionscontains all abstract contracts and interfaces to use in your codeMedicicontains the implementations for the abstractions aboveMedici.DependencyInjectioncontains basic extensions for yourIServiceCollectionfor proper dependency registrationMedici.CQRS.Abstractionscontains abstract contracts to CQRS and Result patternsMedici.Behaviors.Validationcontains simple validation pre-processor realisationMedici.OpenProcessorscontains the implementations for open pre/post behavior
Message types
IBaseRequest- marker interface for requestsIRequest- a request message, no return value (including generic variants)ICommand- a command message with a Result-pattern responseIQuery- a query message with a Result-pattern response
Handler types
IRequestHandler<in TRequest>IRequestHandler<in TRequest, TResponse>ICommandHandler<in TCommand>ICommandHandler<in TCommand, TResponse>IQueryHandler<in TQuery>IQueryHandler<in TQuery, TResponse>
Pipeline types
RequestPreProcessorBehavior<TRequest, TResponse>RequestPostProcessorBehavior<TRequest, TResponse>
Result pattern types
ResultResult<TValue>
Configuration with IServiceCollection
Medici supports Microsoft.Extensions.DependencyInjection.Abstractions directly. To register various Medici services and handlers:
services.AddMedici(cfg => cfg.RegisterServicesFromAssemblyWithType<Program>());
or with an assembly:
services.AddMedici(cfg => cfg.RegisterServicesFromAssembly(typeof(Program).Assembly));
This registers:
IMedicias transientISenderas transientIRequestHandler<,>concrete implementations as transientIRequestHandler<>concrete implementations as transient
To register pre/post processors:
services.AddMedici(cfg => {
cfg.RegisterServicesFromAssembly(typeof(Program).Assembly);
cfg.AddRequestPreProcessor<PingPreProcessor>();
cfg.AddRequestPostProcessor<PingPongPostProcessor>();
});
or with implementation type
services.AddMedici(cfg => {
cfg.RegisterServicesFromAssembly(typeof(Program).Assembly);
cfg.AddRequestPreProcessor<IPingPreProcessor, PingPreProcessor>();
cfg.AddRequestPostProcessor<IPingPongPostProcessor, PingPongPostProcessor>();
});
Third-Party Notices
- This package depends on Scrutor, licensed under the MIT License.
- This package depends on FluentValidation, licensed under the Apache License 2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Medici.Abstractions (>= 1.0.1)
- Scrutor (>= 7.0.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Medici:
| Package | Downloads |
|---|---|
|
Medici.DependencyInjection
Simple implementation of mediator pattern in .NET |
|
|
Medici.Behaviors.Validation
Simple implementation of mediator pattern in .NET |
|
|
Medici.OpenProcessors
Simple implementation of mediator pattern in .NET |
GitHub repositories
This package is not used by any popular GitHub repositories.