Большой рефактор
This commit is contained in:
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eModel.Model.Common;
|
||||
|
||||
public partial class Frequency
|
||||
public class Frequency
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
|
||||
@@ -18,17 +18,19 @@ public static class LocaleExtension
|
||||
|
||||
public static LocaleType GetTypeByString(this string localeType)
|
||||
{
|
||||
foreach (System.Reflection.FieldInfo field in typeof(LocaleType).GetFields())
|
||||
foreach (FieldInfo field in typeof(LocaleType).GetFields())
|
||||
{
|
||||
if (
|
||||
Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute))
|
||||
is DescriptionAttribute descriptionAttribute
|
||||
is not DescriptionAttribute descriptionAttribute
|
||||
)
|
||||
{
|
||||
if (descriptionAttribute.Description == localeType)
|
||||
{
|
||||
return (LocaleType)field.GetValue(null)!;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (descriptionAttribute.Description == localeType)
|
||||
{
|
||||
return (LocaleType)field.GetValue(null)!;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eModel.Model.Common;
|
||||
|
||||
public partial class Training
|
||||
public class Training
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
|
||||
Reference in New Issue
Block a user