From 8d5c6f49e8890c5c9945bb8036bd5876b830fb9c Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Fri, 21 May 2021 11:13:07 +0300 Subject: [PATCH] Set lookup property value if url is not null or empty. --- .../CachedObjectExtensionsDtoService.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs index 22102f82c5..8e5d205867 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs @@ -141,18 +141,23 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending OnTable = new ExtensionPropertyUiTableDto { IsVisible = propertyConfig.UI.OnTable.IsVisible - }, - Lookup = new ExtensionPropertyUiLookupDto - { - Url = propertyConfig.UI.Lookup.Url, - ResultListPropertyName = propertyConfig.UI.Lookup.ResultListPropertyName, - DisplayPropertyName = propertyConfig.UI.Lookup.DisplayPropertyName, - ValuePropertyName = propertyConfig.UI.Lookup.ValuePropertyName, - FilterParamName = propertyConfig.UI.Lookup.FilterParamName } } }; + if (!propertyConfig.UI.Lookup.Url.IsNullOrEmpty()) + { + extensionPropertyDto.Ui.Lookup = new ExtensionPropertyUiLookupDto + { + Url = propertyConfig.UI.Lookup.Url, + ResultListPropertyName = propertyConfig.UI.Lookup.ResultListPropertyName, + DisplayPropertyName = propertyConfig.UI.Lookup.DisplayPropertyName, + ValuePropertyName = propertyConfig.UI.Lookup.ValuePropertyName, + FilterParamName = propertyConfig.UI.Lookup.FilterParamName + }; + } + + foreach (var attribute in propertyConfig.Attributes) { extensionPropertyDto.Attributes.Add(