Exemple #1
0
        /// <summary>Initializes a new instance of the <see cref="RequestPipelineComponent{T}"/> class.</summary>
        /// <param name="placement">The placement.</param>
        /// <param name="order">The order.</param>
        public RequestPipelineComponent(PipelinePlacement placement, int order = 0)
        {
            this.Placement = placement;

            this.Order = order < 0
                ? 0
                : order;
        }
Exemple #2
0
        /// <summary>Initializes a new instance of the <see cref="ApiRequestPipelineAttribute"/> class.</summary>
        /// <param name="pipelineType">Type of the pipeline.</param>
        /// <param name="placement">The placement.</param>
        /// <param name="order">The order.</param>
        public ApiRequestPipelineAttribute(Type pipelineType, PipelinePlacement placement, int order = 0)
        {
            if (pipelineType == null)
            {
                throw new ArgumentNullException(nameof(pipelineType));
            }

            if (pipelineType.GetInterface(nameof(IPipelineComponent), false) == null)
            {
                throw new ArgumentException($"{nameof(pipelineType)} must implement interface {typeof(IPipelineComponent).AssemblyQualifiedName}");
            }

            this.PipelineType = pipelineType;
            this.Placement    = placement;

            this.Order = order < 0
                ? 0
                : order;
        }