MediatR.Extensions.FluentValidation.AspNetCore 1.0.1

MediatR intgration with FluentValidation validation library using ASP.NET Core.

Install-Package MediatR.Extensions.FluentValidation.AspNetCore -Version 1.0.1
dotnet add package MediatR.Extensions.FluentValidation.AspNetCore --version 1.0.1
<PackageReference Include="MediatR.Extensions.FluentValidation.AspNetCore" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MediatR.Extensions.FluentValidation.AspNetCore --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

MediatR.Extensions.FluentValidation.AspNetCore

NuGet
NuGet
license

MediatR extension for FluentValidation using asp.net core

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


public class GenerateInvoiceValidator : AbstractValidator<GenerateInvoiceCommand>
{
    public Valid()
    {
        RuleFor(x => x.Month).LowerThan(13);
        // etc.
    }
}

More examples check FluentValidation docs: https://fluentvalidation.net/start

MediatR.Extensions.FluentValidation.AspNetCore

NuGet
NuGet
license

MediatR extension for FluentValidation using asp.net core

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


public class GenerateInvoiceValidator : AbstractValidator<GenerateInvoiceCommand>
{
    public Valid()
    {
        RuleFor(x => x.Month).LowerThan(13);
        // etc.
    }
}

More examples check FluentValidation docs: https://fluentvalidation.net/start

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 1,124 9/3/2019
1.0.0 44 9/3/2019