I'm using FluentValidation.AspNetCore library (Version="10.3.3") for a .Net Core project.
To register validators i use this:
services.AddValidatorsFromAssemblyContaining<TestValidator>();
For example i have class called Test and i can inject validator for this class like this:
public class Service : IService
{
private readonly IValidator<Test> _testValidator;
public Service(IValidator<Test> testValidator)
{
_testValidator = testValidator;
}
}
But i dont know how to inject all registered validators into my Service constructor as IEnumerable instance. So what is the correct way to do it?