From f926804dbe4e05ba2aa7be1ba67ccdc1dc97019e Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 22 Aug 2023 09:09:09 +0800 Subject: [PATCH] Make `layout` nullable. --- .../Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs | 2 +- .../LayoutHook/ViewComponentHelperLayoutHookExtensions.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs index 562f3151e9..b4ea393fe7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs @@ -16,7 +16,7 @@ public class LayoutHookViewComponent : AbpViewComponent Options = options.Value; } - public virtual IViewComponentResult Invoke(string name, string layout) + public virtual IViewComponentResult Invoke(string name, string? layout) { var hooks = Options.Hooks.GetOrDefault(name)? .Where(IsViewComponent) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/ViewComponentHelperLayoutHookExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/ViewComponentHelperLayoutHookExtensions.cs index 516c1234a0..d5c42a42cd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/ViewComponentHelperLayoutHookExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/ViewComponentHelperLayoutHookExtensions.cs @@ -9,7 +9,7 @@ public static class ViewComponentHelperLayoutHookExtensions public static Task InvokeLayoutHookAsync( this IViewComponentHelper componentHelper, string name, - string layout) + string? layout = null) { return componentHelper.InvokeAsync( typeof(LayoutHookViewComponent),