Files
David Štaleker c4883e4296 dev
2024-03-10 18:58:24 +01:00

49 lines
1.3 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using ZpcBulletinBoard.Classes;
using static ZpcBulletinBoard.Models.Editor.BulletinBoard;
namespace ZpcBulletinBoard.Models.Editor
{
public class BulletinBoardPage
{
public enum TypeEnum
{
[Display(Name = "Deska")]
Board = 1,
[Display(Name = "Slika")]
Image = 2,
[Display(Name = "Zunanja povezava")]
ExternalLink = 3
}
[Key]
public int IdBulletinBoardPage { get; set; }
[Required]
[Display(Name = "Ime")]
public string Name { get; set; }
[Required]
[Display(Name = "Razmerje")]
public RatioEnum Ratio { get; set; }
[NotMapped]
public string RatioString => Ratio.GetAttributeOfType<DisplayAttribute>().Name ?? "";
[Required]
[Display(Name = "Tip")]
public TypeEnum Type { get; set; }
public string? Image { get; set; }
public string? ExternalLink { get; set; }
[InverseProperty("BulletinBoardPage")]
public virtual ICollection<BulletinBoardPageLink> Links { get; set; }
[InverseProperty("BulletinBoardPage")]
public virtual ICollection<Note> Notes { get; set; }
}
}