I18n через jsonb-поля
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Pf2eModel.Model.Base.Keywords;
|
||||
using Pf2eModel.Model.Base.Source;
|
||||
using Pf2eModel.Model.Base.Targets;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@@ -16,9 +17,8 @@ public class Entity
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
[MaxLength(Pf2eDbContext.NameLength)]
|
||||
[Comment("Отображаемое имя")]
|
||||
public string Name { get; set; } = null!;
|
||||
public LocaleString Name { get; set; } = new();
|
||||
|
||||
[Column(Order = 3)]
|
||||
[Comment("Тип объекта")]
|
||||
@@ -53,8 +53,6 @@ public class Entity
|
||||
|
||||
public virtual ICollection<Keyword> Keywords { get; set; } = [];
|
||||
|
||||
public virtual ICollection<EntityAlias> Aliases { get; set; } = [];
|
||||
|
||||
public virtual ICollection<EntitySource> Sources { get; set; } = [];
|
||||
|
||||
public virtual ICollection<EntityExternal> Externals { get; set; } = [];
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eModel.Model.Base;
|
||||
|
||||
[PrimaryKey(nameof(EntityId), nameof(Type))]
|
||||
public partial class EntityAlias
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public int EntityId { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public AliasType Type { get; set; } = AliasType.Other;
|
||||
|
||||
[Column(Order = 3)]
|
||||
[MaxLength(Pf2eDbContext.NameLength)]
|
||||
public string Alias { get; set; } = null!;
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual Entity Entity { get; set; } = null!;
|
||||
}
|
||||
Reference in New Issue
Block a user