Skip to content

Commit

Permalink
feat(module: table): add support for Display attribute (#1310)
Browse files Browse the repository at this point in the history
feat(module:table): add support for Display attribute

Display attribute is widely used to specify display text for entity properties.
Table component should get column names from Display attribute instances.

Closes #1278
  • Loading branch information
anranruye committed Apr 4, 2021
1 parent 2933340 commit 2e0a1f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/core/Reflection/PropertyReflector.cs
Expand Up @@ -21,7 +21,9 @@ private PropertyReflector(PropertyInfo propertyInfo)
{
this.PropertyInfo = propertyInfo;
this.RequiredAttribute = propertyInfo.GetCustomAttribute<RequiredAttribute>(true);
this.DisplayName = propertyInfo.GetCustomAttribute<DisplayNameAttribute>(true)?.DisplayName ?? propertyInfo.Name;
this.DisplayName = propertyInfo.GetCustomAttribute<DisplayNameAttribute>(true)?.DisplayName ??
propertyInfo.GetCustomAttribute<DisplayAttribute>(true)?.Name ??
propertyInfo.Name;
this.PropertyName = PropertyInfo.Name;
}

Expand Down

0 comments on commit 2e0a1f6

Please sign in to comment.