Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Add all the assemblies to MediatR
services.AddMediatR(typeof(DABBaseRequest).GetTypeInfo().Assembly);
// For all the validators, register them with dependency injection as scoped
AssemblyScanner.FindValidatorsInAssembly(typeof(DABBaseRequest).Assembly)
.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