using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Jellyfin.Data.Enums; namespace Jellyfin.Data.Entities { public class AccessSchedule { /// /// Initializes a new instance of the class. /// Default constructor. Protected due to required properties, but present because EF needs it. /// protected AccessSchedule() { } /// /// Initializes a new instance of the class. /// /// The day of the week. /// The start hour. /// The end hour. public AccessSchedule(DynamicDayOfWeek dayOfWeek, double startHour, double endHour) { DayOfWeek = dayOfWeek; StartHour = startHour; EndHour = endHour; } /// /// Factory method /// /// The day of the week. /// The start hour. /// The end hour. /// The newly created instance. public static AccessSchedule CreateInstance(DynamicDayOfWeek dayOfWeek, double startHour, double endHour) { return new AccessSchedule(dayOfWeek, startHour, endHour); } [Key] [Required] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; protected set; } /// /// Gets or sets the day of week. /// /// The day of week. [Required] public DynamicDayOfWeek DayOfWeek { get; set; } /// /// Gets or sets the start hour. /// /// The start hour. [Required] public double StartHour { get; set; } /// /// Gets or sets the end hour. /// /// The end hour. [Required] public double EndHour { get; set; } } }