Moongazing.OrionGuard.MediatR
6.1.0
dotnet add package Moongazing.OrionGuard.MediatR --version 6.1.0
NuGet\Install-Package Moongazing.OrionGuard.MediatR -Version 6.1.0
<PackageReference Include="Moongazing.OrionGuard.MediatR" Version="6.1.0" />
<PackageVersion Include="Moongazing.OrionGuard.MediatR" Version="6.1.0" />
<PackageReference Include="Moongazing.OrionGuard.MediatR" />
paket add Moongazing.OrionGuard.MediatR --version 6.1.0
#r "nuget: Moongazing.OrionGuard.MediatR, 6.1.0"
#:package Moongazing.OrionGuard.MediatR@6.1.0
#addin nuget:?package=Moongazing.OrionGuard.MediatR&version=6.1.0
#tool nuget:?package=Moongazing.OrionGuard.MediatR&version=6.1.0
Moongazing.OrionGuard.MediatR
MediatR integration for OrionGuard — runs your OrionGuard validators automatically inside the MediatR pipeline before each request handler.
What this package adds
ValidationBehavior<TRequest, TResponse>— a MediatR pipeline behavior that locates anyIValidator<TRequest>registered in DI and executes it before the handler.AddOrionGuardMediatR(...)— a service-collection extension that registers the behavior and scans the supplied assemblies for validators.- CQRS-friendly — zero reflection overhead after the first request thanks to MediatR's own DI resolution.
Install
dotnet add package Moongazing.OrionGuard.MediatR
Requires MediatR in your application; the core OrionGuard package is brought in transitively.
Quick start
using Moongazing.OrionGuard.MediatR;
builder.Services.AddOrionGuardMediatR(typeof(Program).Assembly);
// Any IValidator<TRequest> is executed automatically before its handler:
public sealed class CreateUserValidator : AbstractValidator<CreateUserCommand>
{
public CreateUserValidator()
{
RuleFor(x => x.Email, "Email", p => p.NotEmpty().Email());
RuleFor(x => x.Password, "Password", p => p.NotEmpty().MinLength(8));
}
}
When validation fails, the pipeline short-circuits with a ValidationException carrying the full GuardResult — you can convert it to ProblemDetails with the companion Moongazing.OrionGuard.AspNetCore package.
Targets
.NET 8.0, .NET 9.0, .NET 10.0.
License
MIT. See the main repository for full docs, CHANGELOG, and samples.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- MediatR (>= 12.4.1)
- OrionGuard (>= 6.1.0)
-
net8.0
- MediatR (>= 12.4.1)
- OrionGuard (>= 6.1.0)
-
net9.0
- MediatR (>= 12.4.1)
- OrionGuard (>= 6.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 6.1.0 | 143 | 4/19/2026 |