feat: 显示名称支持私有字段
This commit is contained in:
parent
e800e1889c
commit
d0ecd71a46
|
@ -93,7 +93,7 @@ namespace Bootstrap.Admin.Components
|
|||
var cacheKey = (ModelType: fieldIdentifier.Model.GetType(), fieldIdentifier.FieldName);
|
||||
if (!_propertyInfoCache.TryGetValue(cacheKey, out propertyInfo))
|
||||
{
|
||||
propertyInfo = cacheKey.ModelType.GetProperty(cacheKey.FieldName);
|
||||
propertyInfo = cacheKey.ModelType.GetProperty(cacheKey.FieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
|
||||
_propertyInfoCache[cacheKey] = propertyInfo;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using Bootstrap.Admin.Models;
|
||||
using Bootstrap.Admin.Shared;
|
||||
using Bootstrap.Security;
|
||||
|
@ -41,6 +41,7 @@ namespace Bootstrap.Pages.Admin.Components
|
|||
/// <summary>
|
||||
/// 获得/设置 当前用户显示名称
|
||||
/// </summary>
|
||||
[DisplayName("显示名称")]
|
||||
protected string DisplayName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue