Работа над маршрутизацией

This commit is contained in:
2025-10-06 17:50:53 +04:00
parent 94c9ce1264
commit fd80bdc93e
7 changed files with 99 additions and 32 deletions
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Reflection;
using NpgsqlTypes;
using Pf2e.Database.Model.Enum;
namespace Pf2e.Web.Helpers
{
public static class PgNameHelper
{
public static string GetPgName(EntityType entityType)
{
var fieldInfo = entityType.GetType().GetField(entityType.ToString());
var pgNameAttribute = fieldInfo?.GetCustomAttribute<PgNameAttribute>();
return pgNameAttribute?.PgName ?? entityType.ToString().ToLower();
}
}
}