Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Add all the assemblies to MediatR
// For all the validators, register them with dependency injection as scoped
.ForEach(item => services.AddScoped(item.InterfaceType, item.ValidatorType));
// Add the custome pipeline validation to DI
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(MyCustomPipelineValidationBehavior<,>));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment