示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceRouteBuilder"/> class.
        /// </summary>
        /// <param name="routes">The routes builder.</param>
        public ServiceRouteBuilder(RouteBuilder routes)
        {
            _routes           = routes;
            _serviceProvider  = _routes.ServiceProvider;
            _negotiateHandler = _serviceProvider.GetRequiredService <NegotiateHandler>();

            var loggerFactory = _serviceProvider.GetService <ILoggerFactory>() ?? NullLoggerFactory.Instance;

            _logger = loggerFactory.CreateLogger <ServiceRouteBuilder>();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceRouteBuilder"/> class.
 /// </summary>
 /// <param name="routes">The routes builder.</param>
 public ServiceRouteBuilder(RouteBuilder routes)
 {
     _routes           = routes;
     _serviceProvider  = _routes.ServiceProvider;
     _negotiateHandler = _serviceProvider.GetRequiredService <NegotiateHandler>();
 }