using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Runtime.CompilerServices; namespace Jellyfin.Data.Entities { [Table("MusicAlbumMetadata")] public partial class MusicAlbumMetadata : Metadata { partial void Init(); /// /// Default constructor. Protected due to required properties, but present because EF needs it. /// protected MusicAlbumMetadata() : base() { Labels = new HashSet(); Init(); } /// /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. /// public static MusicAlbumMetadata CreateMusicAlbumMetadataUnsafe() { return new MusicAlbumMetadata(); } /// /// Public constructor with required data /// /// The title or name of the object /// ISO-639-3 3-character language codes /// public MusicAlbumMetadata(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0) { if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); this.Title = title; if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); this.Language = language; if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0)); _musicalbum0.MusicAlbumMetadata.Add(this); this.Labels = new HashSet(); Init(); } /// /// Static create function (for use in LINQ queries, etc.) /// /// The title or name of the object /// ISO-639-3 3-character language codes /// public static MusicAlbumMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0) { return new MusicAlbumMetadata(title, language, dateadded, datemodified, _musicalbum0); } /************************************************************************* * Properties *************************************************************************/ /// /// Backing field for Barcode /// protected string _Barcode; /// /// When provided in a partial class, allows value of Barcode to be changed before setting. /// partial void SetBarcode(string oldValue, ref string newValue); /// /// When provided in a partial class, allows value of Barcode to be changed before returning. /// partial void GetBarcode(ref string result); /// /// Max length = 255 /// [MaxLength(255)] [StringLength(255)] public string Barcode { get { string value = _Barcode; GetBarcode(ref value); return (_Barcode = value); } set { string oldValue = _Barcode; SetBarcode(oldValue, ref value); if (oldValue != value) { _Barcode = value; } } } /// /// Backing field for LabelNumber /// protected string _LabelNumber; /// /// When provided in a partial class, allows value of LabelNumber to be changed before setting. /// partial void SetLabelNumber(string oldValue, ref string newValue); /// /// When provided in a partial class, allows value of LabelNumber to be changed before returning. /// partial void GetLabelNumber(ref string result); /// /// Max length = 255 /// [MaxLength(255)] [StringLength(255)] public string LabelNumber { get { string value = _LabelNumber; GetLabelNumber(ref value); return (_LabelNumber = value); } set { string oldValue = _LabelNumber; SetLabelNumber(oldValue, ref value); if (oldValue != value) { _LabelNumber = value; } } } /// /// Backing field for Country /// protected string _Country; /// /// When provided in a partial class, allows value of Country to be changed before setting. /// partial void SetCountry(string oldValue, ref string newValue); /// /// When provided in a partial class, allows value of Country to be changed before returning. /// partial void GetCountry(ref string result); /// /// Max length = 2 /// [MaxLength(2)] [StringLength(2)] public string Country { get { string value = _Country; GetCountry(ref value); return (_Country = value); } set { string oldValue = _Country; SetCountry(oldValue, ref value); if (oldValue != value) { _Country = value; } } } /************************************************************************* * Navigation properties *************************************************************************/ [ForeignKey("Company_Labels_Id")] public virtual ICollection Labels { get; protected set; } } }