Документирование и небольшой рефакторинг модели.
This commit is contained in:
@@ -10,51 +10,93 @@ using Pf2eModel.Model.Structure;
|
||||
|
||||
namespace Pf2eModel.Model.Base;
|
||||
|
||||
/// <summary>
|
||||
/// Корневая сущность.
|
||||
/// </summary>
|
||||
public class Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// Идентификатор сущности.
|
||||
/// </summary>
|
||||
[Key]
|
||||
[Column(Order = 1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Отображаемое имя сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 2)]
|
||||
[Comment("Отображаемое имя")]
|
||||
public LocaleString Name { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Тип сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 3)]
|
||||
[Comment("Тип объекта")]
|
||||
[Comment("Тип сущности")]
|
||||
public EntityType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Часть имени в URL.
|
||||
/// </summary>
|
||||
[Column(Order = 4)]
|
||||
[MaxLength(Pf2eDbContext.NameLength)]
|
||||
[Comment("Часть имени в URL")]
|
||||
public string Slug { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Изображение сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 5)]
|
||||
[StringLength(255)]
|
||||
[Comment("Изображение объекта")]
|
||||
public string Img { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Текстовое описание сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 6)]
|
||||
[Comment("Текстовое описание объекта")]
|
||||
// ReSharper disable once EntityFramework.ModelValidation.UnlimitedStringLength
|
||||
[Comment("Текстовое описание сущности")]
|
||||
public string Description { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Редкость сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 7)]
|
||||
[Comment("Редкость сущности")]
|
||||
public EntityRarity Rarity { get; set; } = EntityRarity.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Флаг, указывающий, что у объекта существует перевод.
|
||||
/// </summary>
|
||||
[Column(Order = 8)]
|
||||
[Comment("Флаг, указывающий, что у объекта существует перевод")]
|
||||
[Comment("Флаг, указывающий, что у сущности существует перевод")]
|
||||
public bool? IsTranslated { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи.
|
||||
/// </summary>
|
||||
[Column(Order = 9)]
|
||||
[Comment("Флаг, указывающий, что объект был проверен и не требует автоматической перезаписи")]
|
||||
[Comment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи")]
|
||||
public bool? IsChecked { get; set; } = false;
|
||||
|
||||
public virtual ICollection<Trait> Traits { get; set; } = [];
|
||||
/// <summary>
|
||||
/// Коллекция признаков, связанных с сущностью.
|
||||
/// </summary>
|
||||
public ICollection<Trait> Traits { get; set; } = [];
|
||||
|
||||
public virtual ICollection<Keyword> Keywords { get; set; } = [];
|
||||
/// <summary>
|
||||
/// Коллекция ключевых слов, связанных с сущностью.
|
||||
/// </summary>
|
||||
public ICollection<Keyword> Keywords { get; set; } = [];
|
||||
|
||||
public virtual ICollection<EntitySource> Sources { get; set; } = [];
|
||||
/// <summary>
|
||||
/// Коллекция источников, связанных с сущностью.
|
||||
/// </summary>
|
||||
public ICollection<EntitySource> Sources { get; set; } = [];
|
||||
|
||||
public virtual ICollection<EntityExternal> Externals { get; set; } = [];
|
||||
/// <summary>
|
||||
/// Коллекция внешних ссылок, связанных с сущностью.
|
||||
/// </summary>
|
||||
public ICollection<EntityExternal> Externals { get; set; } = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user