43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Newtonsoft.Json;
|
|
using Pf2eModel.Model.Enum;
|
|
|
|
namespace Pf2eModel.Model.Structure.ClassRelation;
|
|
|
|
/// <summary>
|
|
/// Набор ключевых атрибутов класса.
|
|
/// </summary>
|
|
public class ClassKeyAttribute
|
|
{
|
|
/// <summary>
|
|
/// Идентификатор ключевого атрибута класса.
|
|
/// </summary>
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
[Column(Order = 1)]
|
|
[Comment("Идентификатор")]
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Идентификатор класса, к которому относится ключевой атрибут.
|
|
/// </summary>
|
|
[Column(Order = 2)]
|
|
[Comment("Идентификатор класса")]
|
|
public int ClassId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Ключевой атрибут класса.
|
|
/// </summary>
|
|
[Column(Order = 3)]
|
|
[Comment("Атрибут")]
|
|
public AttributeValues Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Класс, к которому относится ключевой атрибут.
|
|
/// </summary>
|
|
[JsonIgnore]
|
|
public Class Class { get; set; } = null!;
|
|
}
|