32 lines
805 B
C#
32 lines
805 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace WatchLog.Data
|
|
{
|
|
public class Label
|
|
{
|
|
[Key]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[MaxLength(50)]
|
|
public required string Name { get; set; }
|
|
|
|
[Required]
|
|
public required DateTime CreationTime { get; set; }
|
|
|
|
public DateTime? LastChange { get; set; }
|
|
|
|
|
|
// --- Foreign Key ---
|
|
[Required]
|
|
public int CreatorId { get; set; }
|
|
|
|
|
|
// --- Navigation Properties ---
|
|
[ForeignKey(nameof(CreatorId))]
|
|
public virtual User User { get; set; } = null!;
|
|
|
|
public virtual ICollection<LinkTablePrivateLabel> LinkTablePrivateLabels { get; set; } = new List<LinkTablePrivateLabel>();
|
|
}
|
|
} |