52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Pf2e.Database.Model.Base.Targets;
|
|
|
|
/// <summary>
|
|
/// Цель внешней ссылки.
|
|
/// </summary>
|
|
public class ExternalTarget
|
|
{
|
|
/// <summary>
|
|
/// Идентификатор цели.
|
|
/// </summary>
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
[Column(Order = 1)]
|
|
[Comment("Идентификатор")]
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Название цели.
|
|
/// </summary>
|
|
[Column(Order = 2)]
|
|
[StringLength(Pf2eDbContext.NameLength)]
|
|
[Comment("Отображаемое имя")]
|
|
public string Name { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Иконка цели.
|
|
/// </summary>
|
|
[Column(Order = 3)]
|
|
[StringLength(255)]
|
|
[Comment("Иконка цели")]
|
|
public string Icon { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Префикс для URL-адреса внешней ссылки.
|
|
/// </summary>
|
|
[Column(Order = 3)]
|
|
[StringLength(Pf2eDbContext.NameLength)]
|
|
[Comment("Префикс для URL-адреса внешней ссылки")]
|
|
public string Prefix { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Коллекция сущностей, которые ссылаются на эту цель.
|
|
/// </summary>
|
|
[JsonIgnore]
|
|
public ICollection<EntityExternal> EntityExternals { get; set; } = [];
|
|
}
|