MediatR.Extensions.FluentValidation.AspNetCore
1.1.0
See the version list below for details.
dotnet add package MediatR.Extensions.FluentValidation.AspNetCore --version 1.1.0
NuGet\Install-Package MediatR.Extensions.FluentValidation.AspNetCore -Version 1.1.0
<PackageReference Include="MediatR.Extensions.FluentValidation.AspNetCore" Version="1.1.0" />
paket add MediatR.Extensions.FluentValidation.AspNetCore --version 1.1.0
#r "nuget: MediatR.Extensions.FluentValidation.AspNetCore, 1.1.0"
// Install MediatR.Extensions.FluentValidation.AspNetCore as a Cake Addin #addin nuget:?package=MediatR.Extensions.FluentValidation.AspNetCore&version=1.1.0 // Install MediatR.Extensions.FluentValidation.AspNetCore as a Cake Tool #tool nuget:?package=MediatR.Extensions.FluentValidation.AspNetCore&version=1.1.0
MediatR.Extensions.FluentValidation.AspNetCore
MediatR extension for FluentValidation using asp.net core
Install
A priori you need to install packages Mediatr and FluentValidation then continue below
Install with nuget
Install-Package MediatR.Extensions.FluentValidation.AspNetCore
Install with .NET CLI
dotnet add package MediatR.Extensions.FluentValidation.AspNetCore
How to use
Setup - Add configuration in startup
public void ConfigureServices(IServiceCollection services)
{
// Add framework services etc.
services.AddMvc();
var domainAssembly = typeof(GenerateInvoiceHandler).GetTypeInfo().Assembly;
// Add MediatR
services.AddMediatR(domainAssembly);
//Add FluentValidation
services.AddFluentValidation(new[] {domainAssembly});
//Add other stuffs
...
}
Use
Just to write down validators for IRequest
implementation. Validation will be executed before handling IRequestHandler
.
public class GenerateInvoiceValidator : AbstractValidator<GenerateInvoiceRequest>
{
public GenerateInvoiceValidator()
{
RuleFor(x => x.Month).LowerThan(13);
// etc.
}
}
public class GenerateInvoiceRequest : IRequest
{
public int Month { get; set; }
}
public class GenerateInvoiceRequestHandler : IRequestHandler<GenerateInvoiceRequest>
{
public async Task<Unit> Handle(GenerateInvoiceRequest request, CancellationToken cancellationToken)
{
// request data has been validated
...
}
}
More examples check FluentValidation docs: https://fluentvalidation.net/start
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- FluentValidation (>= 8.2.2)
- FluentValidation.DependencyInjectionExtensions (>= 8.2.2)
- MediatR (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 2.1.0)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on MediatR.Extensions.FluentValidation.AspNetCore:
Package | Downloads |
---|---|
NeerCore.Application.MediatR
The NeerCore.Application.MediatR package provides classes for simplified application configuration using the MediatR library. It is a library for simplified writing of .NET apps. It integrates a popular set of core libraries that are required for developing full-fledged apps, but they don't come out of the box in ASP.NET. NeerCore can be used as shown in the examples in the official repository, or separately in parts that you need. You can also use part of the code from the repository if you do not need to include "one more nuget package" or if your project is not support the version of .NET on which NeerCore was created. |
|
Atlas.Framework.CleanArchitecture
Package Description |
|
SharedKernel.Application
SharedKernel.Application |
|
EPS.SharedKernel.Application
EPS.SharedKernel.Application |
|
Kros.CqrsTemplate
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
5.1.0 | 506,944 | 11/19/2023 |
5.0.0 | 48,635 | 10/14/2023 |
4.0.0 | 763,999 | 10/17/2022 |
3.0.0 | 270,503 | 5/9/2022 |
2.0.0 | 183,034 | 1/15/2022 |
1.2.0 | 338,465 | 5/13/2021 |
1.1.1 | 333,587 | 8/23/2020 |
1.1.0 | 28,625 | 8/5/2020 |
1.0.3 | 3,370 | 7/31/2020 |
1.0.2 | 19,944 | 6/18/2020 |
1.0.1 | 45,181 | 9/3/2019 |
1.0.0 | 6,855 | 9/3/2019 |