Popularity
0.9
Growing
Activity
6.0
-
0
3
1

Programming language: C#
License: MIT License
Tags: Misc     FluentValidation     MediatR    

AdaskoTheBeAsT.FluentValidation.MediatR alternatives and similar packages

Based on the "Misc" category.
Alternatively, view AdaskoTheBeAsT.FluentValidation.MediatR alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of AdaskoTheBeAsT.FluentValidation.MediatR or a related project?

Add another 'Misc' Package

README

AdaskoTheBeAsT.FluentValidation.MediatR

FluentValidation behavior for MediatR

Badges

Build Status Azure DevOps tests Azure DevOps coverage Quality Gate Status Sonar Tests Sonar Test Count Sonar Test Execution Time Sonar Coverage Nuget

Usage

It can be used in combination with AdaskoTheBeAsT.FluentValidation.SimpleInjector AdaskoTheBeAsT.MediatR.SimpleInjector

Validators registered as single

There should be only one validator per target If there is multiple combined validators needed then prepare one which will gather all rules from other based on Fluent Validation Including Rules and mark all sub validators with attribute SkipValidatorRegistrationAttribute.

    container.AddFluentValidation(
        cfg =>
        {
            cfg.WithAssembliesToScan(assemblies);
            cfg.AsScoped();
            cfg.RegisterAsSingleValidator(); // can be skipped as it is default
        });

    container.AddMediatR(
        cfg =>
        {
            cfg.WithAssembliesToScan(assemblies);
            cfg.UsingBuiltinPipelineProcessorBehaviors(true);
            cfg.UsingPipelineProcessorBehaviors(typeof(FluentValidationPipelineBehavior<,>));
        });

Validators registered as collection

    container.AddFluentValidation(
        cfg =>
        {
            cfg.WithAssembliesToScan(assemblies);
            cfg.AsScoped();
            cfg.RegisterAsValidatorCollection();
        });

    container.AddMediatR(
        cfg =>
        {
            cfg.WithAssembliesToScan(assemblies);
            cfg.UsingBuiltinPipelineProcessorBehaviors(true);
            cfg.UsingPipelineProcessorBehaviors(typeof(FluentValidationCollectionPipelineBehavior<,>));
        });