Fix display name helper not working.

This commit is contained in:
2025-09-12 11:30:49 +01:00
parent 1c37141dc5
commit 6e091568d2

View File

@@ -1,4 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Reflection;
namespace Aaru.Server;
@@ -11,10 +11,10 @@ public static class DisplayNameHelper
if(prop is null) return propertyName;
DisplayAttribute? displayAttr = prop.GetCustomAttributes(typeof(DisplayAttribute), true)
.OfType<DisplayAttribute>()
DisplayNameAttribute? displayAttr = prop.GetCustomAttributes(typeof(DisplayNameAttribute), true)
.OfType<DisplayNameAttribute>()
.FirstOrDefault();
return displayAttr?.Name ?? propertyName;
return displayAttr?.DisplayName ?? propertyName;
}
}