mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 11:14:27 +00:00
Fix display name helper not working.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Aaru.Server;
|
namespace Aaru.Server;
|
||||||
@@ -11,10 +11,10 @@ public static class DisplayNameHelper
|
|||||||
|
|
||||||
if(prop is null) return propertyName;
|
if(prop is null) return propertyName;
|
||||||
|
|
||||||
DisplayAttribute? displayAttr = prop.GetCustomAttributes(typeof(DisplayAttribute), true)
|
DisplayNameAttribute? displayAttr = prop.GetCustomAttributes(typeof(DisplayNameAttribute), true)
|
||||||
.OfType<DisplayAttribute>()
|
.OfType<DisplayNameAttribute>()
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
return displayAttr?.Name ?? propertyName;
|
return displayAttr?.DisplayName ?? propertyName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user