MusicAlbumMetadata.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace Jellyfin.Data.Entities
  6. {
  7. public partial class MusicAlbumMetadata : Metadata
  8. {
  9. partial void Init();
  10. /// <summary>
  11. /// Default constructor. Protected due to required properties, but present because EF needs it.
  12. /// </summary>
  13. protected MusicAlbumMetadata()
  14. {
  15. Labels = new HashSet<Company>();
  16. Init();
  17. }
  18. /// <summary>
  19. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  20. /// </summary>
  21. public static MusicAlbumMetadata CreateMusicAlbumMetadataUnsafe()
  22. {
  23. return new MusicAlbumMetadata();
  24. }
  25. /// <summary>
  26. /// Public constructor with required data
  27. /// </summary>
  28. /// <param name="title">The title or name of the object</param>
  29. /// <param name="language">ISO-639-3 3-character language codes</param>
  30. /// <param name="_musicalbum0"></param>
  31. public MusicAlbumMetadata(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0)
  32. {
  33. if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
  34. this.Title = title;
  35. if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
  36. this.Language = language;
  37. if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0));
  38. _musicalbum0.MusicAlbumMetadata.Add(this);
  39. this.Labels = new HashSet<Company>();
  40. Init();
  41. }
  42. /// <summary>
  43. /// Static create function (for use in LINQ queries, etc.)
  44. /// </summary>
  45. /// <param name="title">The title or name of the object</param>
  46. /// <param name="language">ISO-639-3 3-character language codes</param>
  47. /// <param name="_musicalbum0"></param>
  48. public static MusicAlbumMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0)
  49. {
  50. return new MusicAlbumMetadata(title, language, dateadded, datemodified, _musicalbum0);
  51. }
  52. /*************************************************************************
  53. * Properties
  54. *************************************************************************/
  55. /// <summary>
  56. /// Backing field for Barcode
  57. /// </summary>
  58. protected string _Barcode;
  59. /// <summary>
  60. /// When provided in a partial class, allows value of Barcode to be changed before setting.
  61. /// </summary>
  62. partial void SetBarcode(string oldValue, ref string newValue);
  63. /// <summary>
  64. /// When provided in a partial class, allows value of Barcode to be changed before returning.
  65. /// </summary>
  66. partial void GetBarcode(ref string result);
  67. /// <summary>
  68. /// Max length = 255
  69. /// </summary>
  70. [MaxLength(255)]
  71. [StringLength(255)]
  72. public string Barcode
  73. {
  74. get
  75. {
  76. string value = _Barcode;
  77. GetBarcode(ref value);
  78. return (_Barcode = value);
  79. }
  80. set
  81. {
  82. string oldValue = _Barcode;
  83. SetBarcode(oldValue, ref value);
  84. if (oldValue != value)
  85. {
  86. _Barcode = value;
  87. }
  88. }
  89. }
  90. /// <summary>
  91. /// Backing field for LabelNumber
  92. /// </summary>
  93. protected string _LabelNumber;
  94. /// <summary>
  95. /// When provided in a partial class, allows value of LabelNumber to be changed before setting.
  96. /// </summary>
  97. partial void SetLabelNumber(string oldValue, ref string newValue);
  98. /// <summary>
  99. /// When provided in a partial class, allows value of LabelNumber to be changed before returning.
  100. /// </summary>
  101. partial void GetLabelNumber(ref string result);
  102. /// <summary>
  103. /// Max length = 255
  104. /// </summary>
  105. [MaxLength(255)]
  106. [StringLength(255)]
  107. public string LabelNumber
  108. {
  109. get
  110. {
  111. string value = _LabelNumber;
  112. GetLabelNumber(ref value);
  113. return (_LabelNumber = value);
  114. }
  115. set
  116. {
  117. string oldValue = _LabelNumber;
  118. SetLabelNumber(oldValue, ref value);
  119. if (oldValue != value)
  120. {
  121. _LabelNumber = value;
  122. }
  123. }
  124. }
  125. /// <summary>
  126. /// Backing field for Country
  127. /// </summary>
  128. protected string _Country;
  129. /// <summary>
  130. /// When provided in a partial class, allows value of Country to be changed before setting.
  131. /// </summary>
  132. partial void SetCountry(string oldValue, ref string newValue);
  133. /// <summary>
  134. /// When provided in a partial class, allows value of Country to be changed before returning.
  135. /// </summary>
  136. partial void GetCountry(ref string result);
  137. /// <summary>
  138. /// Max length = 2
  139. /// </summary>
  140. [MaxLength(2)]
  141. [StringLength(2)]
  142. public string Country
  143. {
  144. get
  145. {
  146. string value = _Country;
  147. GetCountry(ref value);
  148. return (_Country = value);
  149. }
  150. set
  151. {
  152. string oldValue = _Country;
  153. SetCountry(oldValue, ref value);
  154. if (oldValue != value)
  155. {
  156. _Country = value;
  157. }
  158. }
  159. }
  160. /*************************************************************************
  161. * Navigation properties
  162. *************************************************************************/
  163. [ForeignKey("Company_Labels_Id")]
  164. public virtual ICollection<Company> Labels { get; protected set; }
  165. }
  166. }