コード例 #1
0
 private static async Task <IActionResult> RunControllerAction(PagesController controller, PageRequestModel pageRequestModel, string actionName)
 {
     return(actionName switch
     {
         nameof(PagesController.HtmlHead) => await controller.HtmlHead(pageRequestModel).ConfigureAwait(false),
         nameof(PagesController.Breadcrumb) => await controller.Breadcrumb(pageRequestModel).ConfigureAwait(false),
         nameof(PagesController.BodyTop) => controller.BodyTop(pageRequestModel),
         nameof(PagesController.HeroBanner) => await controller.HeroBanner(pageRequestModel).ConfigureAwait(false),
         nameof(PagesController.SidebarRight) => controller.SidebarRight(pageRequestModel),
         nameof(PagesController.SidebarLeft) => controller.SidebarLeft(pageRequestModel),
         nameof(PagesController.BodyFooter) => controller.BodyFooter(pageRequestModel),
         _ => await controller.Body(pageRequestModel).ConfigureAwait(false),
     });
        private static async Task <IActionResult> RunControllerAction(PagesController controller, string category, string article, string actionName)
        {
            switch (actionName)
            {
            case "Head":
                return(await controller.Head(category, article).ConfigureAwait(false));

            case "Breadcrumb":
                return(await controller.Breadcrumb(category, article).ConfigureAwait(false));

            default:
                return(await controller.Body(category, article).ConfigureAwait(false));
            }
        }