Stratara.Validation
4.4.10
Prefix Reserved
See the version list below for details.
dotnet add package Stratara.Validation --version 4.4.10
NuGet\Install-Package Stratara.Validation -Version 4.4.10
<PackageReference Include="Stratara.Validation" Version="4.4.10" />
<PackageVersion Include="Stratara.Validation" Version="4.4.10" />
<PackageReference Include="Stratara.Validation" />
paket add Stratara.Validation --version 4.4.10
#r "nuget: Stratara.Validation, 4.4.10"
#:package Stratara.Validation@4.4.10
#addin nuget:?package=Stratara.Validation&version=4.4.10
#tool nuget:?package=Stratara.Validation&version=4.4.10
Stratara.Validation
Derived. The behaviour described here is specified under
openspec/specs/. Those specifications are the source; this page explains and illustrates them.
License: MIT.
Vendor-neutral request validation for Stratara's CQRS pipeline. A mediator pipeline behavior
runs your IValidator<T> implementations before the handler and throws an aggregated
StrataraValidationException when validation fails — no third-party validation dependency in
the default path.
Quick start
// 1. Register the behavior (outermost) + discover validators.
builder.Services
.AddStrataraValidation()
.AddValidatorsFromAssemblyContaining<IAppMarker>();
// 2. Write a validator (the contracts live in Stratara.Abstractions.Validation).
public sealed class CreateOrderValidator : IValidator<CreateOrder>
{
public ValueTask<ValidationResult> ValidateAsync(CreateOrder cmd, CancellationToken ct = default)
=> ValueTask.FromResult(string.IsNullOrWhiteSpace(cmd.CustomerId)
? new ValidationResult([new ValidationFailure(nameof(cmd.CustomerId), "Customer is required.")])
: ValidationResult.Success);
}
// 3. Catch the failure in your global handler and map it to your error model.
catch (StrataraValidationException ex)
{
// ex.Failures -> RFC-7807 ProblemDetails 400, your error codes, etc.
}
How it works
AddStrataraValidation()registersIPipelineBehaviorfor both request shapes (IRequestandIRequest<TResult>). Register it before other behaviors so validation runs outermost — before authorization, auditing, and the handler.- All validators for a request run; their failures are aggregated.
- Severity policy: only
ValidationSeverity.Errorblocks (throwsStrataraValidationException).WarningandInfofailures pass through and are logged.
Contracts
The validation contracts (IValidator<T>, ValidationResult, ValidationFailure,
ValidationSeverity, StrataraValidationException) live in Stratara.Abstractions
(namespace Stratara.Abstractions.Validation) so consumers can implement validators and catch
the exception without referencing this behavior package.
The contract shape is FluentValidation-compatible; an optional
Stratara.Validation.FluentValidation adapter can be shipped to plug FluentValidation
validators into the same pipeline.
Dependencies
Stratara.AbstractionsStratara.MediatorStratara.DiagnosticsMicrosoft.Extensions.DependencyInjection.AbstractionsMicrosoft.Extensions.Logging.Abstractions
| 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
- JetBrains.Annotations (>= 2026.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Stratara.Abstractions (>= 4.4.10)
- Stratara.Diagnostics (>= 4.4.10)
- Stratara.Mediator (>= 4.4.10)
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 |
|---|---|---|
| 4.8.0 | 158 | 11/6/2026 |
| 4.7.1 | 93 | 11/5/2026 |
| 4.7.0 | 537 | 10/30/2026 |
| 4.6.1 | 96 | 10/29/2026 |
| 4.6.0 | 193 | 10/28/2026 |
| 4.5.0 | 274 | 10/28/2026 |
| 4.4.10 | 205 | 10/26/2026 |
| 4.4.9 | 112 | 10/26/2026 |
| 4.4.8 | 254 | 10/24/2026 |
| 4.4.7 | 117 | 10/23/2026 |
| 4.4.6 | 222 | 10/22/2026 |
| 4.4.5 | 649 | 10/14/2026 |
| 4.4.4 | 397 | 10/10/2026 |
| 4.4.3 | 126 | 10/10/2026 |
| 4.4.2 | 471 | 10/2/2026 |
| 4.4.1 | 429 | 9/29/2026 |
| 4.4.0 | 152 | 9/27/2026 |
| 4.3.1 | 136 | 9/25/2026 |
| 4.3.0 | 400 | 9/23/2026 |
| 4.2.0 | 160 | 9/18/2026 |
A release for hosts on the Orleans execution model. A durable timer now answers its tick while its handler runs, so a
long handler leaves no reminder error in the silo's log, and a timer that fails is logged by the framework with its
owner and purpose. A commit no longer constructs every registered projection to learn which store readers to wake. No
API change, no schema change and no migration.
### Changed
- **A commit no longer constructs every projection.** On the Orleans execution model, every command that committed
facts constructed each registered projection, with its dependencies, only to learn the names of the store readers to
wake. The names are now worked out once per silo, and the wait for a projection, the rebuild and the full replay's
checkpoint reset use the same list. A rebuild of a name that is not registered is refused before any reader is
paused, with the same message as before.
### Fixed
- **A durable timer answers its tick while its handler runs.** On the Orleans execution model, a durable timer's
reminder call stayed open until its handler returned, so a handler longer than the runtime's response timeout made
Orleans log `Could not deliver reminder tick` at Error for every tick it outlasted. The tick is now answered at once
and the handler runs in a call that carries no response timeout. The timer still fires once per due time, a tick
during its handler still does nothing, and a handler stopped with its silo still fires again on the next one.
- **A failing timer is logged.** A durable timer whose handler threw — or whose owner check or unregistration
failed — was visible only as Orleans' reminder error line. It is now logged as `117_137` `TimerFiringFailed` (Error)
with the owner, the purpose and the exception, and the timer fires again after its retry period as before.