コード例 #1
0
        public AutoRegisterMiddleware(IApiVersionRoutePolicy routePolicy, IOptions <ApiVersioningOptions> options)
        {
            Contract.Requires(routePolicy != null);
            Contract.Requires(options != null);

            this.routePolicy = routePolicy;
            this.options     = options;
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ODataApiVersionActionSelector"/> class.
 /// </summary>
 /// <param name="actionDescriptorCollectionProvider">The <see cref="IActionDescriptorCollectionProvider "/> used to select candidate routes.</param>
 /// <param name="actionConstraintCache">The <see cref="ActionConstraintCache"/> that providers a set of <see cref="IActionConstraint"/> instances.</param>
 /// <param name="options">The <see cref="ApiVersioningOptions">options</see> associated with the action selector.</param>
 /// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
 /// <param name="routePolicy">The <see cref="IApiVersionRoutePolicy">route policy</see> applied to candidate matches.</param>
 public ODataApiVersionActionSelector(
     IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
     ActionConstraintCache actionConstraintCache,
     IOptions <ApiVersioningOptions> options,
     ILoggerFactory loggerFactory,
     IApiVersionRoutePolicy routePolicy) : base(actionDescriptorCollectionProvider, actionConstraintCache, options, loggerFactory, routePolicy)
 {
 }
コード例 #3
0
 public AutoRegisterMiddleware(
     IApiVersionRoutePolicy routePolicy,
     IOptions <ApiVersioningOptions> options,
     IOptions <MvcOptions> mvcOptions)
 {
     this.routePolicy = routePolicy;
     this.options     = options;
     this.mvcOptions  = mvcOptions;
 }
コード例 #4
0
 public TestApiVersionActionSelector(
     IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
     IEnumerable <IActionConstraintProvider> actionConstraintProviders,
     IOptions <ApiVersioningOptions> options,
     ILoggerFactory loggerFactory,
     IApiVersionRoutePolicy routePolicy)
     : base(actionDescriptorCollectionProvider, actionConstraintProviders, options, loggerFactory, routePolicy)
 {
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ApiVersionActionSelector"/> class.
 /// </summary>
 /// <param name="actionDescriptorCollectionProvider">The <see cref="IActionDescriptorCollectionProvider "/> used to select candidate routes.</param>
 /// <param name="actionConstraintProviders">The <see cref="IEnumerable{T}">sequence</see> of <see cref="IActionConstraintProvider">action constraint providers</see>.</param>
 /// <param name="options">The <see cref="ApiVersioningOptions">options</see> associated with the action selector.</param>
 /// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
 /// <param name="routePolicy">The <see cref="IApiVersionRoutePolicy">route policy</see> applied to candidate matches.</param>
 public ApiVersionActionSelector(
     IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
     IEnumerable <IActionConstraintProvider> actionConstraintProviders,
     IOptions <ApiVersioningOptions> options,
     ILoggerFactory loggerFactory,
     IApiVersionRoutePolicy routePolicy)
 {
     this.actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
     actionConstraintCache = new ActionConstraintCache(actionDescriptorCollectionProvider, actionConstraintProviders);
     this.options          = options;
     Logger      = loggerFactory.CreateLogger(GetType());
     RoutePolicy = routePolicy;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApiVersionActionSelector"/> class.
 /// </summary>
 /// <param name="actionDescriptorCollectionProvider">The <see cref="IActionDescriptorCollectionProvider "/> used to select candidate routes.</param>
 /// <param name="actionConstraintCache">The <see cref="ActionConstraintCache"/> that providers a set of <see cref="IActionConstraint"/> instances.</param>
 /// <param name="options">The <see cref="ApiVersioningOptions">options</see> associated with the action selector.</param>
 /// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
 /// <param name="routePolicy">The <see cref="IApiVersionRoutePolicy">route policy</see> applied to candidate matches.</param>
 public ApiVersionActionSelector(
     IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
     ActionConstraintCache actionConstraintCache,
     IOptions <ApiVersioningOptions> options,
     ILoggerFactory loggerFactory,
     IApiVersionRoutePolicy routePolicy)
 {
     this.actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
     this.actionConstraintCache = actionConstraintCache;
     this.options = options;
     Logger       = loggerFactory.CreateLogger(GetType());
     RoutePolicy  = routePolicy;
 }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ODataApiVersionActionSelector"/> class.
 /// </summary>
 /// <param name="actionDescriptorCollectionProvider">The <see cref="IActionDescriptorCollectionProvider "/> used to select candidate routes.</param>
 /// <param name="actionConstraintProviders">The <see cref="IEnumerable{T}">sequence</see> of <see cref="IActionConstraintProvider">action constraint providers</see>.</param>
 /// <param name="options">The <see cref="ApiVersioningOptions">options</see> associated with the action selector.</param>
 /// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
 /// <param name="routePolicy">The <see cref="IApiVersionRoutePolicy">route policy</see> applied to candidate matches.</param>
 /// <param name="modelBinderFactory">The <see cref="IModelBinderFactory"/> used to create model binders.</param>
 /// <param name="modelMetadataProvider">The <see cref="IModelMetadataProvider"/> used to resolve model metadata.</param>
 /// <param name="mvcOptions">The <see cref="MvcOptions">MVC options</see> associated with the action selector.</param>
 public ODataApiVersionActionSelector(
     IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
     IEnumerable <IActionConstraintProvider> actionConstraintProviders,
     IOptions <ApiVersioningOptions> options,
     ILoggerFactory loggerFactory,
     IApiVersionRoutePolicy routePolicy,
     IModelBinderFactory modelBinderFactory,
     IModelMetadataProvider modelMetadataProvider,
     IOptions <MvcOptions> mvcOptions)
     : base(actionDescriptorCollectionProvider, actionConstraintProviders, options, loggerFactory, routePolicy)
 {
     this.modelBinderFactory    = modelBinderFactory;
     this.modelMetadataProvider = modelMetadataProvider;
     this.mvcOptions            = mvcOptions;
 }
コード例 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ApiVersionActionSelector"/> class.
        /// </summary>
        /// <param name="actionDescriptorCollectionProvider">The <see cref="IActionDescriptorCollectionProvider "/> used to select candidate routes.</param>
        /// <param name="actionConstraintCache">The <see cref="ActionConstraintCache"/> that providers a set of <see cref="IActionConstraint"/> instances.</param>
        /// <param name="options">The <see cref="ApiVersioningOptions">options</see> associated with the action selector.</param>
        /// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
        /// <param name="routePolicy">The <see cref="IApiVersionRoutePolicy">route policy</see> applied to candidate matches.</param>
        public ApiVersionActionSelector(
            IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
            ActionConstraintCache actionConstraintCache,
            IOptions <ApiVersioningOptions> options,
            ILoggerFactory loggerFactory,
            IApiVersionRoutePolicy routePolicy)
        {
            Arg.NotNull(actionDescriptorCollectionProvider, nameof(actionDescriptorCollectionProvider));
            Arg.NotNull(actionConstraintCache, nameof(actionConstraintCache));
            Arg.NotNull(options, nameof(options));
            Arg.NotNull(loggerFactory, nameof(loggerFactory));
            Arg.NotNull(routePolicy, nameof(routePolicy));

            this.actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
            this.actionConstraintCache = actionConstraintCache;
            this.options = options;
            Logger       = loggerFactory.CreateLogger(GetType());
            RoutePolicy  = routePolicy;
        }
コード例 #9
0
 public CatchAllRouteHandler(IApiVersionRoutePolicy routePolicy) => this.routePolicy = routePolicy;
コード例 #10
0
 public InjectApiVersionRoutePolicy(IApiVersionRoutePolicy routePolicy) => this.routePolicy = routePolicy;