Browse Source

hide lookup property from Getoperation and refactoring.

pull/6219/head
Ilkay Ilknur 6 years ago
parent
commit
700f9884e6
  1. 26
      framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/EntityExtensionConfiguration.cs

26
framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/EntityExtensionConfiguration.cs

@ -52,23 +52,23 @@ namespace Volo.Abp.ObjectExtending.Modularity
NormalizeProperty(propertyInfo);
AddLookupProperty(propertyInfo);
return this;
}
private void AddLookupProperty(ExtensionPropertyConfiguration propertyInfo)
{
if (!propertyInfo.UI.Lookup.Url.IsNullOrEmpty())
{
var lookupPropertyName = $"{propertyInfo.Name}_Text";
var lookupPropertyInfo = Properties.GetOrAdd(
lookupPropertyName,
() => new ExtensionPropertyConfiguration(this, typeof(string), lookupPropertyName)
);
lookupPropertyInfo.DisplayName = propertyInfo.DisplayName ?? new FixedLocalizableString(propertyInfo.Name);
AddLookupTextProperty(propertyInfo);
propertyInfo.UI.OnTable.IsVisible = false;
propertyInfo.Api.OnGet.IsAvailable = false;
}
return this;
}
private void AddLookupTextProperty(ExtensionPropertyConfiguration propertyInfo)
{
var lookupTextPropertyName = $"{propertyInfo.Name}_Text";
var lookupTextPropertyInfo = Properties.GetOrAdd(
lookupTextPropertyName,
() => new ExtensionPropertyConfiguration(this, typeof(string), lookupTextPropertyName)
);
lookupTextPropertyInfo.DisplayName = propertyInfo.DisplayName ?? new FixedLocalizableString(propertyInfo.Name);
}
[NotNull]

Loading…
Cancel
Save