public RequestMatcherFactory(
     IPathPatternToRegexConverter pathPatternToRegexConverter,
     IQueryStringParameterMatcher queryStringParameterMatcher,
     IHeaderParameterMatcher headerParameterMatcher,
     IBodyParameterMatcher bodyParameterMatcher)
 {
     _bodyParameterMatcher        = bodyParameterMatcher ?? throw new ArgumentNullException(nameof(bodyParameterMatcher));
     _headerParameterMatcher      = headerParameterMatcher ?? throw new ArgumentNullException(nameof(headerParameterMatcher));
     _queryStringParameterMatcher = queryStringParameterMatcher ?? throw new ArgumentNullException(nameof(queryStringParameterMatcher));
     _pathPatternToRegexConverter = pathPatternToRegexConverter ?? throw new ArgumentNullException(nameof(pathPatternToRegexConverter));
 }
예제 #2
0
        public OperationMatcher(
            OperationInfo operation,
            IPathPatternToRegexConverter pathPatternToRegexConverter,
            IQueryStringParameterMatcher queryStringParameterMatcher,
            IHeaderParameterMatcher headerParameterMatcher,
            IBodyParameterMatcher bodyParameterMatcher)
        {
            if (pathPatternToRegexConverter == null)
            {
                throw new ArgumentNullException(nameof(pathPatternToRegexConverter));
            }

            _bodyParameterMatcher        = bodyParameterMatcher ?? throw new ArgumentNullException(nameof(bodyParameterMatcher));
            _headerParameterMatcher      = headerParameterMatcher ?? throw new ArgumentNullException(nameof(headerParameterMatcher));
            _queryStringParameterMatcher = queryStringParameterMatcher ?? throw new ArgumentNullException(nameof(queryStringParameterMatcher));

            _operation = operation ?? throw new ArgumentNullException(nameof(operation));
            _regexInfo = pathPatternToRegexConverter.Convert(operation.Path);
        }
 public PathParameterMatcherFactory(IPathPatternToRegexConverter regexConverter)
 {
     _regexConverter = regexConverter ?? throw new ArgumentNullException(nameof(regexConverter));
 }