From b0b16ce5a3521e15714a1d17f2f32aa2e5026b3d Mon Sep 17 00:00:00 2001 From: Argo-Cloud Date: Sun, 28 Mar 2021 01:31:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20GenerateCo?= =?UTF-8?q?lumns=20=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Utils/Utility.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Utils/Utility.cs b/src/BootstrapBlazor/Utils/Utility.cs index ed6075836..4b08b3408 100644 --- a/src/BootstrapBlazor/Utils/Utility.cs +++ b/src/BootstrapBlazor/Utils/Utility.cs @@ -208,7 +208,7 @@ namespace BootstrapBlazor.Components /// /// /// - public static IEnumerable GenerateColumns(Func? predicate = null) where TModel : class + public static IEnumerable GenerateColumns(Func? predicate = null) { if (predicate == null) predicate = p => true; return InternalTableColumn.GetProperties().Where(predicate); -- Gitee From 98265c1d77315522736940dec4f71ae20d9e3e2b Mon Sep 17 00:00:00 2001 From: Argo-Cloud Date: Sun, 28 Mar 2021 01:35:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20SearchDialog=20=E6=9C=AA=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=20Searchable=20=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Dialog/DialogService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Components/Dialog/DialogService.cs b/src/BootstrapBlazor/Components/Dialog/DialogService.cs index 088082b71..9f99a50ef 100644 --- a/src/BootstrapBlazor/Components/Dialog/DialogService.cs +++ b/src/BootstrapBlazor/Components/Dialog/DialogService.cs @@ -49,11 +49,11 @@ namespace BootstrapBlazor.Components option.Component = BootstrapDynamicComponent.CreateComponent>(new[] { - new KeyValuePair(nameof(SearchDialogOption.Model), option.Model!), + new KeyValuePair(nameof(SearchDialogOption.Model), option.Model), new KeyValuePair(nameof(SearchDialogOption.ShowLabel), option.ShowLabel), new KeyValuePair(nameof(SearchDialogOption.ResetButtonText), option.ResetButtonText!), new KeyValuePair(nameof(SearchDialogOption.QueryButtonText), option.QueryButtonText!), - new KeyValuePair(nameof(SearchDialogOption.Items), option.Items!), + new KeyValuePair(nameof(SearchDialogOption.Items), option.Items ?? Utility.GenerateColumns(item => item.Searchable)), new KeyValuePair(nameof(SearchDialogOption.BodyTemplate), option.DialogBodyTemplate!), new KeyValuePair(nameof(SearchDialogOption.OnResetSearchClick), new Func(async () => { -- Gitee