Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BridgeController"/> <see langword="class"/>.
        /// </summary>
        /// <param name="bridgeDispatcher">The value of <see cref="bridgeDispatcher"/>.</param>
        /// <param name="applicationLifetime">The <see cref="IHostApplicationLifetime"/> of the server.</param>
        /// <param name="logger">The value of <see cref="logger"/>.</param>
        public BridgeController(IBridgeDispatcher bridgeDispatcher, IHostApplicationLifetime applicationLifetime, ILogger <BridgeController> logger)
        {
            this.bridgeDispatcher = bridgeDispatcher ?? throw new ArgumentNullException(nameof(bridgeDispatcher));
            if (applicationLifetime == null)
            {
                throw new ArgumentNullException(nameof(applicationLifetime));
            }

            this.logger = logger ?? throw new ArgumentNullException(nameof(logger));

            applicationLifetime.ApplicationStopped.Register(() => requestsProcessed = 0);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="BridgeController"/> <see langword="class"/>.
 /// </summary>
 /// <param name="bridgeDispatcher">The value of <see cref="bridgeDispatcher"/>.</param>
 /// <param name="logger">The value of <see cref="logger"/>.</param>
 public BridgeController(IBridgeDispatcher bridgeDispatcher, ILogger <BridgeController> logger)
 {
     this.bridgeDispatcher = bridgeDispatcher ?? throw new ArgumentNullException(nameof(bridgeDispatcher));
     this.logger           = logger ?? throw new ArgumentNullException(nameof(logger));
 }