-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Validators via Assembly search not working #168
Comments
Hi, I checked this behavior. Make sure that you pass the type from the Assembly that contains inheritors of |
Yes I had a look at this and I copied what James had done in this article https://dev.to/jamesrandall/elegant-azure-functions-development-in-c-with-function-monkey-1ea7 by calling .AddValidatorsFromAssemblyContaining() and it didn't work? Can you give me an example? my validator class looks like: class LoginCommandValidator : AbstractValidator and my function app configuration looks like public class FunctionAppConfiguration : IFunctionAppConfiguration
|
Hi Team,
Am I missing something?
I am trying to use serviceCollection.AddValidatorsFromAssemblyContaining() to effectively find all instances of my fluent validation validators and add them to the service collection as transient however it doesn't appear to pick them up.
However, if I manually add the validator to the service collection via serviceCollection.AddTransient<IValidator, LoginCommandValidator>(); it works.
Am I not using this correctly? It doesn't throw any errors just isn't picking up my validators.
The text was updated successfully, but these errors were encountered: