Exemple #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),
     });