61 lines
2.0 KiB
C#
61 lines
2.0 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
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;
|
|
|
|
namespace Pf2eModel.Model.Base;
|
|
|
|
public class Entity
|
|
{
|
|
[Key]
|
|
[Column(Order = 1)]
|
|
public int Id { get; set; }
|
|
|
|
[Column(Order = 2)]
|
|
[Comment("Отображаемое имя")]
|
|
public LocaleString Name { get; set; } = [];
|
|
|
|
[Column(Order = 3)]
|
|
[Comment("Тип объекта")]
|
|
public EntityType Type { get; set; }
|
|
|
|
[Column(Order = 4)]
|
|
[MaxLength(Pf2eDbContext.NameLength)]
|
|
[Comment("Часть имени в URL")]
|
|
public string Slug { get; set; } = null!;
|
|
|
|
[Column(Order = 5)]
|
|
[StringLength(255)]
|
|
[Comment("Изображение объекта")]
|
|
public string Img { get; set; } = null!;
|
|
|
|
[Column(Order = 6)]
|
|
[Comment("Текстовое описание объекта")]
|
|
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
|
|
public string Description { get; set; } = null!;
|
|
|
|
[Column(Order = 7)]
|
|
public EntityRarity Rarity { get; set; } = EntityRarity.Common;
|
|
|
|
[Column(Order = 8)]
|
|
[Comment("Флаг, указывающий, что у объекта существует перевод")]
|
|
public bool? IsTranslated { get; set; } = false;
|
|
|
|
[Column(Order = 9)]
|
|
[Comment("Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи")]
|
|
public bool? IsChecked { get; set; } = false;
|
|
|
|
public virtual ICollection<Trait> Traits { get; set; } = [];
|
|
|
|
public virtual ICollection<Keyword> Keywords { get; set; } = [];
|
|
|
|
public virtual ICollection<EntitySource> Sources { get; set; } = [];
|
|
|
|
public virtual ICollection<EntityExternal> Externals { get; set; } = [];
|
|
}
|