From acb30e73d68a68984f80e9313f5a42b3fabe7fdc Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Wed, 23 Jun 2021 20:29:39 +0800 Subject: [PATCH 1/2] SetDefaultsForExtraProperties in ExtensionProperties component --- .../ObjectExtending/ExtensionProperties.razor | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor index b8d4a9b715..adc878d8c5 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor @@ -3,27 +3,33 @@ @using Volo.Abp.ObjectExtending @using Volo.Abp.Localization @using Volo.Abp.Data +@using Newtonsoft.Json -@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties()) -{ - if (!propertyInfo.Name.EndsWith("_Text")) +@{ + Entity.SetDefaultsForExtraProperties(); + + foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties()) { - if (propertyInfo.Type.IsEnum) - { - - } - else if (!propertyInfo.Lookup.Url.IsNullOrEmpty()) - { - - } - else + if (!propertyInfo.Name.EndsWith("_Text")) { - var inputType = propertyInfo.GetInputType(); + if (propertyInfo.Type.IsEnum) + { + + } + else if (!propertyInfo.Lookup.Url.IsNullOrEmpty()) + { + + } + else + { + var inputType = propertyInfo.GetInputType(); - __builder.OpenComponent(0, inputType.MakeGenericType(new[] { typeof(TEntityType), typeof(TResourceType) })); - __builder.AddAttribute(1, "PropertyInfo", propertyInfo); - __builder.AddAttribute(2, "Entity", Entity); - __builder.CloseComponent(); + Console.WriteLine(JsonConvert.SerializeObject(propertyInfo)); + __builder.OpenComponent(0, inputType.MakeGenericType(new[] { typeof(TEntityType), typeof(TResourceType) })); + __builder.AddAttribute(1, "PropertyInfo", propertyInfo); + __builder.AddAttribute(2, "Entity", Entity); + __builder.CloseComponent(); + } } } } From 3936269d68affe9ebc9342135ce27340687bfa7c Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Wed, 23 Jun 2021 20:31:59 +0800 Subject: [PATCH 2/2] Update ExtensionProperties.razor --- .../Components/ObjectExtending/ExtensionProperties.razor | 3 --- 1 file changed, 3 deletions(-) diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor index adc878d8c5..f8aad7b5cd 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/ExtensionProperties.razor @@ -3,7 +3,6 @@ @using Volo.Abp.ObjectExtending @using Volo.Abp.Localization @using Volo.Abp.Data -@using Newtonsoft.Json @{ Entity.SetDefaultsForExtraProperties(); @@ -23,8 +22,6 @@ else { var inputType = propertyInfo.GetInputType(); - - Console.WriteLine(JsonConvert.SerializeObject(propertyInfo)); __builder.OpenComponent(0, inputType.MakeGenericType(new[] { typeof(TEntityType), typeof(TResourceType) })); __builder.AddAttribute(1, "PropertyInfo", propertyInfo); __builder.AddAttribute(2, "Entity", Entity);