Документирование и небольшой рефакторинг модели.
This commit is contained in:
@@ -1,29 +1,53 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
/// <summary>
|
||||
/// Правило.
|
||||
/// </summary>
|
||||
[EntityOfType(EntityType.Rule)]
|
||||
public class Rule : IEntity
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Column(Order = 1)]
|
||||
[Comment("Идентификатор")]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Entity Entity { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Порядок отображения.
|
||||
/// </summary>
|
||||
[Column(Order = 2)]
|
||||
[Comment("Порядок отображения")]
|
||||
public int Order { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор родительского правила.
|
||||
/// </summary>
|
||||
[Column(Order = 3)]
|
||||
[Comment("Родительского правило")]
|
||||
public int? ParentId { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Родительское правило.
|
||||
/// </summary>
|
||||
public Rule? Parent { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Дочерние правила.
|
||||
/// </summary>
|
||||
public ICollection<Rule> Children { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Хлебные крошки для отображения в интерфейсе.
|
||||
/// </summary>
|
||||
public string[] Breadcrumbs { get; set; } = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user