using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Jellyfin.Data.Entities { public partial class Person { partial void Init(); /// /// Default constructor. Protected due to required properties, but present because EF needs it. /// protected Person() { Sources = new HashSet(); Init(); } /// /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. /// public static Person CreatePersonUnsafe() { return new Person(); } /// /// Public constructor with required data /// /// /// public Person(Guid urlid, string name, DateTime dateadded, DateTime datemodified) { this.UrlId = urlid; if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name)); this.Name = name; this.Sources = new HashSet(); Init(); } /// /// Static create function (for use in LINQ queries, etc.) /// /// /// public static Person Create(Guid urlid, string name, DateTime dateadded, DateTime datemodified) { return new Person(urlid, name, dateadded, datemodified); } /************************************************************************* * Properties *************************************************************************/ /// /// Backing field for Id /// internal int _Id; /// /// When provided in a partial class, allows value of Id to be changed before setting. /// partial void SetId(int oldValue, ref int newValue); /// /// When provided in a partial class, allows value of Id to be changed before returning. /// partial void GetId(ref int result); /// /// Identity, Indexed, Required /// [Key] [Required] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get { int value = _Id; GetId(ref value); return (_Id = value); } protected set { int oldValue = _Id; SetId(oldValue, ref value); if (oldValue != value) { _Id = value; } } } /// /// Backing field for UrlId /// protected Guid _UrlId; /// /// When provided in a partial class, allows value of UrlId to be changed before setting. /// partial void SetUrlId(Guid oldValue, ref Guid newValue); /// /// When provided in a partial class, allows value of UrlId to be changed before returning. /// partial void GetUrlId(ref Guid result); /// /// Required /// [Required] public Guid UrlId { get { Guid value = _UrlId; GetUrlId(ref value); return (_UrlId = value); } set { Guid oldValue = _UrlId; SetUrlId(oldValue, ref value); if (oldValue != value) { _UrlId = value; } } } /// /// Backing field for Name /// protected string _Name; /// /// When provided in a partial class, allows value of Name to be changed before setting. /// partial void SetName(string oldValue, ref string newValue); /// /// When provided in a partial class, allows value of Name to be changed before returning. /// partial void GetName(ref string result); /// /// Required, Max length = 1024 /// [Required] [MaxLength(1024)] [StringLength(1024)] public string Name { get { string value = _Name; GetName(ref value); return (_Name = value); } set { string oldValue = _Name; SetName(oldValue, ref value); if (oldValue != value) { _Name = value; } } } /// /// Backing field for SourceId /// protected string _SourceId; /// /// When provided in a partial class, allows value of SourceId to be changed before setting. /// partial void SetSourceId(string oldValue, ref string newValue); /// /// When provided in a partial class, allows value of SourceId to be changed before returning. /// partial void GetSourceId(ref string result); /// /// Max length = 255 /// [MaxLength(255)] [StringLength(255)] public string SourceId { get { string value = _SourceId; GetSourceId(ref value); return (_SourceId = value); } set { string oldValue = _SourceId; SetSourceId(oldValue, ref value); if (oldValue != value) { _SourceId = value; } } } /// /// Backing field for DateAdded /// protected DateTime _DateAdded; /// /// When provided in a partial class, allows value of DateAdded to be changed before setting. /// partial void SetDateAdded(DateTime oldValue, ref DateTime newValue); /// /// When provided in a partial class, allows value of DateAdded to be changed before returning. /// partial void GetDateAdded(ref DateTime result); /// /// Required /// [Required] public DateTime DateAdded { get { DateTime value = _DateAdded; GetDateAdded(ref value); return (_DateAdded = value); } internal set { DateTime oldValue = _DateAdded; SetDateAdded(oldValue, ref value); if (oldValue != value) { _DateAdded = value; } } } /// /// Backing field for DateModified /// protected DateTime _DateModified; /// /// When provided in a partial class, allows value of DateModified to be changed before setting. /// partial void SetDateModified(DateTime oldValue, ref DateTime newValue); /// /// When provided in a partial class, allows value of DateModified to be changed before returning. /// partial void GetDateModified(ref DateTime result); /// /// Required /// [Required] public DateTime DateModified { get { DateTime value = _DateModified; GetDateModified(ref value); return (_DateModified = value); } internal set { DateTime oldValue = _DateModified; SetDateModified(oldValue, ref value); if (oldValue != value) { _DateModified = value; } } } /// /// Required, ConcurrenyToken /// [ConcurrencyCheck] [Required] public uint RowVersion { get; set; } public void OnSavingChanges() { RowVersion++; } /************************************************************************* * Navigation properties *************************************************************************/ [ForeignKey("MetadataProviderId_Sources_Id")] public virtual ICollection Sources { get; protected set; } } }