41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using ZpcBulletinBoard.Classes;
|
|
|
|
namespace ZpcBulletinBoard.Models.Editor
|
|
{
|
|
public class BulletinBoard
|
|
{
|
|
public enum RatioEnum
|
|
{
|
|
[Display(Name = "16:9")]
|
|
Ratio16To9 = 1,
|
|
[Display(Name = "4:3")]
|
|
Ratio4To3 = 2
|
|
}
|
|
|
|
[Key]
|
|
public int IdBulletinBoard { get; set; }
|
|
|
|
[Required]
|
|
[Index("IX_BulletinBoardUnique", 1, IsUnique = true)]
|
|
public Guid Guid { 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 ?? "";
|
|
|
|
|
|
// InvoicePart
|
|
[InverseProperty("BulletinBoard")]
|
|
public virtual ICollection<BulletinBoardPageLink> Links { get; set; }
|
|
}
|
|
}
|