public DefaultLinksPolicyProvider(IOptions <LinksOptions> options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            this.options = options.Value;
        }
        public DefaultLinksService(
            IOptions <LinksOptions> options,
            ILogger <DefaultLinksService> logger,
            ILinksHandlerContextFactory contextFactory,
            ILinksPolicyProvider policyProvider,
            IEnumerable <ILinksHandler> handlers,
            IRouteMap routeMap,
            ILinksEvaluator evaluator)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (contextFactory == null)
            {
                throw new ArgumentNullException(nameof(contextFactory));
            }
            if (policyProvider == null)
            {
                throw new ArgumentNullException(nameof(policyProvider));
            }
            if (handlers == null)
            {
                throw new ArgumentNullException(nameof(handlers));
            }
            if (routeMap == null)
            {
                throw new ArgumentNullException(nameof(routeMap));
            }
            if (evaluator == null)
            {
                throw new ArgumentNullException(nameof(evaluator));
            }

            this.options        = options.Value;
            this.logger         = logger;
            this.contextFactory = contextFactory;
            this.policyProvider = policyProvider;
            this.handlers       = handlers.ToArray();
            this.routeMap       = routeMap;
            this.evaluator      = evaluator;
        }
Ejemplo n.º 3
0
 public DefaultLinksEvaluator(IOptions <LinksOptions> options, ILinkTransformationContextFactory contextFactory)
 {
     this.options        = options.Value;
     this.contextFactory = contextFactory;
 }