![]() |
VOOZH | about |
dotnet add package RCommon.FluentValidation --version 2.4.1
NuGet\Install-Package RCommon.FluentValidation -Version 2.4.1
<PackageReference Include="RCommon.FluentValidation" Version="2.4.1" />
<PackageVersion Include="RCommon.FluentValidation" Version="2.4.1" />Directory.Packages.props
<PackageReference Include="RCommon.FluentValidation" />Project file
paket add RCommon.FluentValidation --version 2.4.1
#r "nuget: RCommon.FluentValidation, 2.4.1"
#:package RCommon.FluentValidation@2.4.1
#addin nuget:?package=RCommon.FluentValidation&version=2.4.1Install as a Cake Addin
#tool nuget:?package=RCommon.FluentValidation&version=2.4.1Install as a Cake Tool
FluentValidation integration for RCommon's IValidationProvider abstraction. This package bridges the FluentValidation library into RCommon's validation pipeline, resolving registered IValidator<T> instances from the DI container and executing them with support for automatic CQRS command/query validation.
IValidationProvider using the FluentValidation libraryIValidator<T> instances for a given type from DITask.WhenAllValidationOutcome and ValidationFault typesCqrsValidationOptionsthrowOnFaults behavior to throw ValidationException on failuredotnet add package RCommon.FluentValidation
Register FluentValidation through the RCommon builder and add your validators:
using RCommon;
using RCommon.FluentValidation;
services.AddRCommon(builder =>
{
builder.WithValidation<FluentValidationBuilder>(validation =>
{
validation.AddValidator<CreateOrderDto, CreateOrderDtoValidator>();
// Or scan an assembly for all validators
validation.AddValidatorsFromAssembly(typeof(CreateOrderDtoValidator).Assembly);
});
});
To enable automatic validation in the CQRS pipeline:
services.AddRCommon(builder =>
{
builder.WithValidation<FluentValidationBuilder>(options =>
{
options.ValidateCommands = true;
options.ValidateQueries = true;
});
});
Inject and use IValidationProvider directly when needed:
public class OrderService
{
private readonly IValidationProvider _validator;
public OrderService(IValidationProvider validator)
{
_validator = validator;
}
public async Task CreateOrder(CreateOrderDto dto)
{
var outcome = await _validator.ValidateAsync(dto, throwOnFaults: true);
// If throwOnFaults is false, inspect the outcome manually
if (!outcome.IsValid)
{
foreach (var fault in outcome.Errors)
{
Console.WriteLine($"{fault.PropertyName}: {fault.ErrorMessage}");
}
}
}
}
| Type | Description |
|---|---|
FluentValidationProvider |
IValidationProvider implementation that resolves and runs FluentValidation validators |
FluentValidationBuilder |
Registers FluentValidationProvider into the DI container |
IFluentValidationBuilder |
Builder interface exposing IServiceCollection for validator registration |
FluentValidationBuilderExtensions |
Provides AddValidator<T, TValidator>(), AddValidatorsFromAssembly(), and assembly scanning methods |
ValidationBuilderExtensions |
Provides WithValidation<T>() on IRCommonBuilder for pipeline registration |
For full documentation, visit rcommon.com.
Licensed under the Apache License, Version 2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.0-alpha.3 | 72 | 5/18/2026 |
| 2.4.2-alpha.0.10 | 120 | 4/5/2026 |
| 2.4.2-alpha.0.9 | 68 | 3/26/2026 |
| 2.4.2-alpha.0.8 | 67 | 3/26/2026 |
| 2.4.2-alpha.0.7 | 60 | 3/26/2026 |
| 2.4.2-alpha.0.6 | 65 | 3/25/2026 |
| 2.4.2-alpha.0.5 | 69 | 3/24/2026 |
| 2.4.2-alpha.0.1 | 59 | 3/24/2026 |
| 2.4.1 | 130 | 2/18/2026 |
| 2.3.2-alpha.0.3 | 66 | 2/18/2026 |
| 2.3.2-alpha.0.2 | 75 | 2/18/2026 |
| 2.3.2-alpha.0.1 | 70 | 2/9/2026 |
| 2.3.1 | 197 | 2/5/2026 |
| 2.3.0 | 112 | 2/3/2026 |
| 2.2.2-alpha.0.1 | 409 | 12/11/2025 |
| 2.2.1-alpha.0.2 | 153 | 10/24/2025 |
| 2.2.1-alpha.0.1 | 157 | 10/24/2025 |
| 2.1.11-alpha.0.2 | 153 | 10/24/2025 |
| 2.1.11-alpha.0.1 | 132 | 7/18/2025 |
| 2.1.10 | 309 | 7/17/2025 |