jellyfin/Jellyfin.Data/Entities/AccessSchedule.cs

63 lines
1.9 KiB
C#
Raw Normal View History

2020-05-15 23:24:01 +02:00
using System;
2020-05-13 04:10:35 +02:00
using System.ComponentModel.DataAnnotations.Schema;
2020-05-27 03:20:55 +02:00
using System.Xml.Serialization;
2020-05-13 04:10:35 +02:00
using Jellyfin.Data.Enums;
namespace Jellyfin.Data.Entities
{
2020-05-23 02:20:18 +02:00
/// <summary>
/// An entity representing a user's access schedule.
/// </summary>
2020-05-13 04:10:35 +02:00
public class AccessSchedule
{
/// <summary>
/// Initializes a new instance of the <see cref="AccessSchedule"/> class.
/// </summary>
/// <param name="dayOfWeek">The day of the week.</param>
/// <param name="startHour">The start hour.</param>
/// <param name="endHour">The end hour.</param>
2020-05-23 02:20:18 +02:00
/// <param name="userId">The associated user's id.</param>
2020-05-15 23:24:01 +02:00
public AccessSchedule(DynamicDayOfWeek dayOfWeek, double startHour, double endHour, Guid userId)
2020-05-13 04:10:35 +02:00
{
2020-05-15 23:24:01 +02:00
UserId = userId;
2020-05-13 04:10:35 +02:00
DayOfWeek = dayOfWeek;
StartHour = startHour;
EndHour = endHour;
}
2020-05-23 02:20:18 +02:00
/// <summary>
2021-03-18 00:08:11 +01:00
/// Gets the id of this instance.
2020-05-23 02:20:18 +02:00
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
2020-05-27 03:20:55 +02:00
[XmlIgnore]
2020-05-13 04:10:35 +02:00
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
2021-03-18 00:08:11 +01:00
public int Id { get; private set; }
2020-05-15 23:24:01 +02:00
2020-05-23 02:20:18 +02:00
/// <summary>
2021-03-18 00:08:11 +01:00
/// Gets the id of the associated user.
2020-05-23 02:20:18 +02:00
/// </summary>
2020-05-27 03:20:55 +02:00
[XmlIgnore]
2021-03-18 00:08:11 +01:00
public Guid UserId { get; private set; }
2020-05-13 04:10:35 +02:00
/// <summary>
/// Gets or sets the day of week.
/// </summary>
/// <value>The day of week.</value>
public DynamicDayOfWeek DayOfWeek { get; set; }
/// <summary>
/// Gets or sets the start hour.
/// </summary>
/// <value>The start hour.</value>
public double StartHour { get; set; }
/// <summary>
/// Gets or sets the end hour.
/// </summary>
/// <value>The end hour.</value>
public double EndHour { get; set; }
}
}