Пример #1
0
        /// <summary>
        /// Creates a new instance of the <see cref="HeaderPropagationMessageHandler"/>.
        /// </summary>
        /// <param name="options">The options that define which headers are propagated.</param>
        /// <param name="values">The values of the headers to be propagated populated by the
        /// <see cref="HeaderPropagationMiddleware"/>.</param>
        public HeaderPropagationMessageHandler(IOptions <HeaderPropagationOptions> options, HeaderPropagationValues values)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options = options.Value;

            _values = values ?? throw new ArgumentNullException(nameof(values));
        }
        public HeaderPropagationMiddleware(RequestDelegate next, IOptions <HeaderPropagationOptions> options, HeaderPropagationValues values)
        {
            _next = next ?? throw new ArgumentNullException(nameof(next));

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            _options = options.Value;

            _values = values ?? throw new ArgumentNullException(nameof(values));
        }
 /// <summary>
 /// Creates a new instance of the <see cref="HeaderPropagationMessageHandler"/>.
 /// </summary>
 /// <param name="options">The options that define which headers are propagated.</param>
 /// <param name="values">The values of the headers to be propagated populated by the
 /// <see cref="HeaderPropagationMiddleware"/>.</param>
 public HeaderPropagationMessageHandler(HeaderPropagationMessageHandlerOptions options, HeaderPropagationValues values)
 {
     _options = options ?? throw new ArgumentNullException(nameof(options));
     _values  = values ?? throw new ArgumentNullException(nameof(values));
 }