fix constructor injection for _validators (#1809)

This commit is contained in:
A-Soltani 2022-03-16 23:52:16 +03:30 committed by GitHub
parent 4ecd27ccf6
commit 4458a096c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,9 +3,9 @@
public class ValidatorBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> public class ValidatorBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
{ {
private readonly ILogger<ValidatorBehavior<TRequest, TResponse>> _logger; private readonly ILogger<ValidatorBehavior<TRequest, TResponse>> _logger;
private readonly IValidator<TRequest>[] _validators; private readonly IEnumerable<IValidator<TRequest>> _validators;
public ValidatorBehavior(IValidator<TRequest>[] validators, ILogger<ValidatorBehavior<TRequest, TResponse>> logger) public ValidatorBehavior(IEnumerable<IValidator<TRequest>> validators, ILogger<ValidatorBehavior<TRequest, TResponse>> logger)
{ {
_validators = validators; _validators = validators;
_logger = logger; _logger = logger;