Категория божества
This commit is contained in:
@@ -126,4 +126,10 @@ public enum EntityType
|
||||
/// </summary>
|
||||
[PgName("rule")]
|
||||
Rule,
|
||||
|
||||
/// <summary>
|
||||
/// Категория божества.
|
||||
/// </summary>
|
||||
[PgName("deity_category")]
|
||||
DeityCategory,
|
||||
}
|
||||
|
||||
@@ -115,6 +115,18 @@ public class Deity : IEntity
|
||||
/// </summary>
|
||||
public ICollection<DeityWeapon> DeityWeapons { get; set; } = new List<DeityWeapon>();
|
||||
|
||||
/// <summary>
|
||||
/// Категория божества (связь).
|
||||
/// </summary>
|
||||
public DeityCategory? CategoryEntity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор категории божества.
|
||||
/// </summary>
|
||||
[Column(Order = 12)]
|
||||
[Comment("Идентификатор категории божества")]
|
||||
public int? CategoryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Навыки божества.
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
/// <summary>
|
||||
/// Категория божества.
|
||||
/// </summary>
|
||||
[EntityOfType(EntityType.DeityCategory)]
|
||||
public class DeityCategory : 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 LocaleString Description { get; set; } = [];
|
||||
}
|
||||
@@ -137,6 +137,8 @@ public partial class Pf2eDbContext : DbContext
|
||||
|
||||
public virtual DbSet<Training> Trainings { get; set; }
|
||||
|
||||
public virtual DbSet<DeityCategory> DeityCategories { get; set; }
|
||||
|
||||
public virtual DbSet<Trait> Traits { get; set; }
|
||||
|
||||
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
@@ -571,6 +571,13 @@ public partial class Pf2eDbContext
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
// DeityCategory
|
||||
modelBuilder.Entity<DeityCategory>(entity =>
|
||||
{
|
||||
BindEntity(entity);
|
||||
BindLocaleString(entity, d => d.Description);
|
||||
});
|
||||
|
||||
// Trait
|
||||
modelBuilder.Entity<Trait>(entity =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user