Пример #1
0
        public async Task <IActionResult> ComponentDialog(string component, [FromQuery] string route = null)
        {
            var explorerResult = await _providerFactory.GetExplorerView(component);

            if (string.IsNullOrEmpty(route))
            {
                route = await _providerFactory.GetDefaultRoute(component);
            }

            var model = new UserConsoleViewModel
            {
                DefaultRoute  = route,
                ExplorerViews = new List <FactoryViewResult>()
                {
                    explorerResult
                },
                DefaultContent = await _providerFactory.RenderRoute(route)
            };

            return(PartialView("~/UI/UserConsole/Views/Dialog.cshtml", model));
        }
Пример #2
0
        public async Task <IActionResult> Dialog([FromQuery] string route = null)
        {
            var model = new UserConsoleViewModel();
            var componentExplorers = await _providerFactory.GetExplorerViews();

            model.ExplorerViews = componentExplorers;

            if (componentExplorers != null && componentExplorers.Count() > 0)
            {
                var componentType = componentExplorers.First().Component.ComponentType;

                if (string.IsNullOrEmpty(route))
                {
                    route = await _providerFactory.GetDefaultRoute(componentType);
                }

                model.DefaultRoute   = route;
                model.DefaultContent = await _providerFactory.RenderRoute(route);
            }

            return(PartialView("~/UI/UserConsole/Views/Dialog.cshtml", model));
        }