Exemple #1
0
        public MvcEndpointDataSource(IActionInvokerFactory actionInvokerFactory,
                                     IActionDescriptorProvider actionDiscriptorProvider,
                                     RoutePatternTransformer transformer)
        {
            _actionInvokerFactory = actionInvokerFactory;

            _endpoints = new Lazy <IReadOnlyList <Endpoint> >(Create());

            List <Endpoint> Create()
            {
                var Descriptors = actionDiscriptorProvider.GetActionDescriptors;

                return(Descriptors.Select(CreateEndpoint).ToList());
            }

            Endpoint CreateEndpoint(ActionDescriptor actionDiscriptor)
            {
                var routePattern    = RoutePatternFactory.Parse(actionDiscriptor.RouteInfo.Template);
                var newRoutePattern = transformer.SubstituteRequiredValues(routePattern, new Dictionary <string, string>
                {
                    ["controller"] = actionDiscriptor.ControllerName,
                    ["action"]     = actionDiscriptor.ActionName
                });

                routePattern = routePattern ?? newRoutePattern;
                var endPointBuilder = new RouteEndpointBuilder(InvokeAsync, routePattern, actionDiscriptor.RouteInfo.Order ?? 0);

                endPointBuilder.Metadata.Add(actionDiscriptor);
                return(endPointBuilder.Build());
            }
        }
 public ActionInvokerFactory(IActionResultFactory actionResultFactory,
                             IActionDescriptorProvider actionDescriptorProvider, 
                             IActionInvokerProvider actionInvokerProvider)
 {
     _actionResultFactory = actionResultFactory;
     _actionDescriptorProvider = actionDescriptorProvider;
     _actionInvokerProvider = actionInvokerProvider;
 }
 public ActionInvokerFactory(IActionResultFactory actionResultFactory,
                             IActionDescriptorProvider actionDescriptorProvider, 
                             IActionInvokerProvider actionInvokerProvider)
 {
     _actionResultFactory = actionResultFactory;
     _actionDescriptorProvider = actionDescriptorProvider;
     _actionInvokerProvider = actionInvokerProvider;
 }
Exemple #4
0
        public HomeController(HisarAssemblyComponentsLoader assemblyLoader,
                              ApplicationPartManager partManager,
                              IEnumerable <IApplicationModelProvider> providers,
                              IActionDescriptorProvider actionDescriptorProvider)
        {
            _assemblyLoader = assemblyLoader;
            _partManager    = partManager;
            _providers      = providers.ToList();

            _componentModelBuilderHelper = new ComponentModelBuilderHelper(partManager, _providers);
        }
Exemple #5
0
 public RazorViewEngine(IActionDescriptorProvider actionDescriptorProvider, 
                        IVirtualPathViewFactory virtualPathFactory)
 {
     _actionDescriptorProvider = actionDescriptorProvider;
     _virtualPathFactory = virtualPathFactory;
 }
Exemple #6
0
 public RazorViewEngine(IActionDescriptorProvider actionDescriptorProvider,
                        IVirtualPathViewFactory virtualPathFactory)
 {
     _actionDescriptorProvider = actionDescriptorProvider;
     _virtualPathFactory       = virtualPathFactory;
 }