예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RequestTrackingMiddleware"/> class.
        /// </summary>
        /// <param name="options">The options to control the behavior of the request tracking.</param>
        /// <param name="next">The next pipeline function to process the HTTP context.</param>
        /// <param name="logger">The logger to write diagnostic messages during the request tracking.</param>
        public RequestTrackingMiddleware(
            RequestTrackingOptions options,
            RequestDelegate next,
            ILogger <RequestTrackingMiddleware> logger)
        {
            Guard.NotNull(options, nameof(options));
            Guard.NotNull(next, nameof(next));
            Guard.NotNull(logger, nameof(logger));

            _options = options;
            _next    = next;
            _logger  = logger;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RequestTrackingMiddleware"/> class.
        /// </summary>
        /// <param name="options">The options to control the behavior of the request tracking.</param>
        /// <param name="next">The next pipeline function to process the HTTP context.</param>
        /// <param name="logger">The logger to write telemetry tracking during the request tracking.</param>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="options"/>, <paramref name="next"/>, <paramref name="logger"/> is <c>null</c>.</exception>
        public RequestTrackingMiddleware(
            RequestTrackingOptions options,
            RequestDelegate next,
            ILogger <RequestTrackingMiddleware> logger)
        {
            Guard.NotNull(options, nameof(options), "Requires a set of options to control the behavior of the HTTP tracking middleware");
            Guard.NotNull(next, nameof(next), "Requires a function pipeline to delegate the remainder of the request processing");
            Guard.NotNull(logger, nameof(logger), "Requires a logger instance to write telemetry tracking during the request processing");

            _options = options;
            _next    = next;
            _logger  = logger;
        }