/// <summary>
 /// Creates a new instance of <see cref="ApiDescriptionGroupCollectionProvider"/>.
 /// </summary>
 /// <param name="actionDescriptorCollectionProvider">
 /// The <see cref="IActionDescriptorsCollectionProvider"/>.
 /// </param>
 /// <param name="apiDescriptionProviders">
 /// The <see cref="IEnumerable{IApiDescriptionProvider}}"/>.
 /// </param>
 public ApiDescriptionGroupCollectionProvider(
     IActionDescriptorsCollectionProvider actionDescriptorCollectionProvider,
     IEnumerable <IApiDescriptionProvider> apiDescriptionProviders)
 {
     _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
     _apiDescriptionProviders            = apiDescriptionProviders.OrderBy(item => item.Order).ToArray();
 }
 /// <summary>
 /// Creates a new instance of <see cref="ApiDescriptionGroupCollectionProvider"/>.
 /// </summary>
 /// <param name="actionDescriptorCollectionProvider">
 /// The <see cref="IActionDescriptorsCollectionProvider"/>.
 /// </param>
 /// <param name="apiDescriptionProviders">
 /// The <see cref="IEnumerable{IApiDescriptionProvider}}"/>.
 /// </param>
 public ApiDescriptionGroupCollectionProvider(
     IActionDescriptorsCollectionProvider actionDescriptorCollectionProvider,
     IEnumerable<IApiDescriptionProvider> apiDescriptionProviders)
 {
     _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
     _apiDescriptionProviders = apiDescriptionProviders.OrderBy(item => item.Order).ToArray();
 }
Exemple #3
0
        public AttributeRoute(
            IRouter target,
            IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
            IInlineConstraintResolver constraintResolver,
            ILoggerFactory loggerFactory)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            if (actionDescriptorsCollectionProvider == null)
            {
                throw new ArgumentNullException(nameof(actionDescriptorsCollectionProvider));
            }

            if (constraintResolver == null)
            {
                throw new ArgumentNullException(nameof(constraintResolver));
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _target = target;
            _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
            _constraintResolver = constraintResolver;

            _routeLogger = loggerFactory.CreateLogger<InnerAttributeRoute>();
            _constraintLogger = loggerFactory.CreateLogger(typeof(RouteConstraintMatcher).FullName);
        }
Exemple #4
0
        public AttributeRoute(
            IRouter target,
            IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
            IInlineConstraintResolver constraintResolver,
            ILoggerFactory loggerFactory)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            if (actionDescriptorsCollectionProvider == null)
            {
                throw new ArgumentNullException(nameof(actionDescriptorsCollectionProvider));
            }

            if (constraintResolver == null)
            {
                throw new ArgumentNullException(nameof(constraintResolver));
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _target = target;
            _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
            _constraintResolver = constraintResolver;

            _routeLogger      = loggerFactory.CreateLogger <InnerAttributeRoute>();
            _constraintLogger = loggerFactory.CreateLogger(typeof(RouteConstraintMatcher).FullName);
        }
Exemple #5
0
 /// <summary>
 /// Creates a new instance of <see cref="ApiDescriptionGroupCollectionProvider"/>.
 /// </summary>
 /// <param name="actionDescriptorCollectionProvider">
 /// The <see cref="IActionDescriptorsCollectionProvider"/>.
 /// </param>
 /// <param name="apiDescriptionProvider">
 /// The <see cref="INestedProviderManager{ApiDescriptionProviderContext}"/>.
 /// </param>
 public ApiDescriptionGroupCollectionProvider(
     IActionDescriptorsCollectionProvider actionDescriptorCollectionProvider,
     INestedProviderManager <ApiDescriptionProviderContext> apiDescriptionProvider)
 {
     _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
     _apiDescriptionProvider             = apiDescriptionProvider;
 }
Exemple #6
0
 public DefaultActionSelector(IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
                              IActionBindingContextProvider bindingProvider,
                              [NotNull] ILoggerFactory loggerFactory)
 {
     _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
     _bindingProvider = bindingProvider;
     _logger          = loggerFactory.Create <DefaultActionSelector>();
 }
Exemple #7
0
 public DefaultActionSelector(IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
                              IActionBindingContextProvider bindingProvider,
                              [NotNull] ILoggerFactory loggerFactory)
 {
     _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
     _bindingProvider = bindingProvider;
     _logger = loggerFactory.Create<DefaultActionSelector>();
 }
Exemple #8
0
 public ODataActionSelector(IODataRoutingConvention convention,
                            IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
                            IActionSelectorDecisionTreeProvider decisionTreeProvider,
                            IEnumerable <IActionConstraintProvider> actionConstraintProviders,
                            ILoggerFactory loggerFactory)
 {
     _selector   = new DefaultActionSelector(actionDescriptorsCollectionProvider, decisionTreeProvider, actionConstraintProviders, loggerFactory);
     _convention = convention;
 }
 public ODataActionSelector(IODataRoutingConvention convention,
     IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
     IActionSelectorDecisionTreeProvider decisionTreeProvider,
     IEnumerable<IActionConstraintProvider> actionConstraintProviders,
     ILoggerFactory loggerFactory)
 {
     _selector = new DefaultActionSelector(actionDescriptorsCollectionProvider, decisionTreeProvider, actionConstraintProviders, loggerFactory);
     _convention = convention;
 }
Exemple #10
0
 public GoofyActionSelector(
     IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
     IActionSelectorDecisionTreeProvider decisionTreeProvider,
     IEnumerable <IActionConstraintProvider> actionConstraintProviders,
     ILoggerFactory loggerFactory,
     IComponentStore componentStore)
     : base(actionDescriptorsCollectionProvider, decisionTreeProvider, actionConstraintProviders, loggerFactory)
 {
     _componentStore = componentStore;
 }
Exemple #11
0
 public DefaultActionSelector(
     [NotNull] IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
     [NotNull] IActionSelectorDecisionTreeProvider decisionTreeProvider,
     [NotNull] INestedProviderManager <ActionConstraintProviderContext> actionConstraintProvider,
     [NotNull] ILoggerFactory loggerFactory)
 {
     _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
     _decisionTreeProvider     = decisionTreeProvider;
     _actionConstraintProvider = actionConstraintProvider;
     _logger = loggerFactory.Create <DefaultActionSelector>();
 }
Exemple #12
0
 public DefaultActionSelector(
     IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
     IActionSelectorDecisionTreeProvider decisionTreeProvider,
     IEnumerable <IActionConstraintProvider> actionConstraintProviders,
     ILoggerFactory loggerFactory)
 {
     _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
     _decisionTreeProvider      = decisionTreeProvider;
     _actionConstraintProviders = actionConstraintProviders.OrderBy(item => item.Order).ToArray();
     _logger = loggerFactory.CreateLogger <DefaultActionSelector>();
 }
 public DefaultActionSelector(
     IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
     IActionSelectorDecisionTreeProvider decisionTreeProvider,
     IEnumerable<IActionConstraintProvider> actionConstraintProviders,
     ILoggerFactory loggerFactory)
 {
     _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
     _decisionTreeProvider = decisionTreeProvider;
     _actionConstraintProviders = actionConstraintProviders.OrderBy(item => item.Order).ToArray();
     _logger = loggerFactory.CreateLogger<DefaultActionSelector>();
 }
		public AttributeRouteFetcher(
			IInlineConstraintResolver constraintResolver,
			IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
			IRouteTemplateParser parser, 
			IConstraintsProcessor constraintsProcessor
		)
		{
			_constraintResolver = constraintResolver;
			_actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
			_parser = parser;
			_constraintsProcessor = constraintsProcessor;
		}
        public UmbracoControllerTypeCollection(IActionDescriptorsCollectionProvider actionDescriptorProviderContext)
        {
            if (actionDescriptorProviderContext == null) throw new ArgumentNullException(nameof(actionDescriptorProviderContext));

            _umbracoControllerDescriptors = new Lazy<ControllerActionDescriptor[]>(() =>
            {
                return actionDescriptorProviderContext.ActionDescriptors.Items
                    .OfType<ControllerActionDescriptor>()
                    .Where(x => typeof (IUmbracoController).GetTypeInfo().IsAssignableFrom(x.ControllerTypeInfo))
                    //.Where(x => typeof (UmbracoController).GetTypeInfo().IsAssignableFrom(x.ControllerTypeInfo))
                    .ToArray();
            });
        }
Exemple #16
0
        public AttributeRoute(
            [NotNull] IRouter target,
            [NotNull] IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
            [NotNull] IInlineConstraintResolver constraintResolver,
            [NotNull] ILoggerFactory loggerFactory)
        {
            _target = target;
            _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
            _constraintResolver = constraintResolver;

            _routeLogger      = loggerFactory.CreateLogger <InnerAttributeRoute>();
            _constraintLogger = loggerFactory.CreateLogger(typeof(RouteConstraintMatcher).FullName);
        }
        public AttributeRoute(
            [NotNull] IRouter target,
            [NotNull] IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider,
            [NotNull] IInlineConstraintResolver constraintResolver,
            [NotNull] ILoggerFactory loggerFactory)
        {
            _target = target;
            _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
            _constraintResolver = constraintResolver;

            _routeLogger = loggerFactory.CreateLogger<InnerAttributeRoute>();
            _constraintLogger = loggerFactory.CreateLogger(typeof(RouteConstraintMatcher).FullName);
        }
        public UmbracoControllerTypeCollection(IActionDescriptorsCollectionProvider actionDescriptorProviderContext)
        {
            if (actionDescriptorProviderContext == null)
            {
                throw new ArgumentNullException(nameof(actionDescriptorProviderContext));
            }

            _umbracoControllerDescriptors = new Lazy <ControllerActionDescriptor[]>(() =>
            {
                return(actionDescriptorProviderContext.ActionDescriptors.Items
                       .OfType <ControllerActionDescriptor>()
                       .Where(x => typeof(UmbracoController).GetTypeInfo().IsAssignableFrom(x.ControllerTypeInfo))
                       .ToArray());
            });
        }
        private void SetupLoggingAndLogStartupInfo(ILoggerFactory loggerFactory, IActionDescriptorsCollectionProvider adp)
        {
            loggerFactory.AddConsole();

            var logger = loggerFactory.Create("Startup");

            // This is kinda nice for attaching a debugger for self hosting scenarios
            logger.WriteInformation("Process Id: " + Process.GetCurrentProcess().Id);

            // The code below will be added to MVC at some point in the future
            foreach (var action in adp.ActionDescriptors.Items)
            {
                var constraint = action?.ActionConstraints?.OfType <HttpMethodConstraint>()?.SingleOrDefault();
                if (constraint != null)
                {
                    logger.WriteInformation(action.DisplayName + ": " + constraint.HttpMethods.Single());
                }
                else
                {
                    logger.WriteInformation(action.DisplayName + ": " + "AnyVerb");
                }
            }
        }
 /// <summary>
 /// Creates a new <see cref="ActionSelectorDecisionTreeProvider"/>.
 /// </summary>
 /// <param name="actionDescriptorsCollectionProvider">
 /// The <see cref="IActionDescriptorsCollectionProvider"/>.
 /// </param>
 public ActionSelectorDecisionTreeProvider(
     IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider)
 {
     _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
 }
        public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IActionDescriptorsCollectionProvider adp)
        {
            SetupLoggingAndLogStartupInfo(loggerFactory, adp);

            app.UseMvc(route => { }); // no conventional routes (this will become the default shortly)
        }
Exemple #22
0
 /// <summary>
 /// Creates a new <see cref="ActionSelectorDecisionTreeProvider"/>.
 /// </summary>
 /// <param name="actionDescriptorsCollectionProvider">
 /// The <see cref="IActionDescriptorsCollectionProvider"/>.
 /// </param>
 public ActionSelectorDecisionTreeProvider(
     IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider)
 {
     _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
 }
	    public DefaultRouteFilter(IRouteJsConfiguration configuration, IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider)
	    {
		    _configuration = configuration;
		    _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider;
		    BuildLists();
	    }