MusicAlbumMetadata.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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))
  34. {
  35. throw new ArgumentNullException(nameof(title));
  36. }
  37. this.Title = title;
  38. if (string.IsNullOrEmpty(language))
  39. {
  40. throw new ArgumentNullException(nameof(language));
  41. }
  42. this.Language = language;
  43. if (_musicalbum0 == null)
  44. {
  45. throw new ArgumentNullException(nameof(_musicalbum0));
  46. }
  47. _musicalbum0.MusicAlbumMetadata.Add(this);
  48. this.Labels = new HashSet<Company>();
  49. Init();
  50. }
  51. /// <summary>
  52. /// Static create function (for use in LINQ queries, etc.)
  53. /// </summary>
  54. /// <param name="title">The title or name of the object.</param>
  55. /// <param name="language">ISO-639-3 3-character language codes.</param>
  56. /// <param name="_musicalbum0"></param>
  57. public static MusicAlbumMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0)
  58. {
  59. return new MusicAlbumMetadata(title, language, dateadded, datemodified, _musicalbum0);
  60. }
  61. /*************************************************************************
  62. * Properties
  63. *************************************************************************/
  64. /// <summary>
  65. /// Backing field for Barcode.
  66. /// </summary>
  67. protected string _Barcode;
  68. /// <summary>
  69. /// When provided in a partial class, allows value of Barcode to be changed before setting.
  70. /// </summary>
  71. partial void SetBarcode(string oldValue, ref string newValue);
  72. /// <summary>
  73. /// When provided in a partial class, allows value of Barcode to be changed before returning.
  74. /// </summary>
  75. partial void GetBarcode(ref string result);
  76. /// <summary>
  77. /// Max length = 255
  78. /// </summary>
  79. [MaxLength(255)]
  80. [StringLength(255)]
  81. public string Barcode
  82. {
  83. get
  84. {
  85. string value = _Barcode;
  86. GetBarcode(ref value);
  87. return _Barcode = value;
  88. }
  89. set
  90. {
  91. string oldValue = _Barcode;
  92. SetBarcode(oldValue, ref value);
  93. if (oldValue != value)
  94. {
  95. _Barcode = value;
  96. }
  97. }
  98. }
  99. /// <summary>
  100. /// Backing field for LabelNumber.
  101. /// </summary>
  102. protected string _LabelNumber;
  103. /// <summary>
  104. /// When provided in a partial class, allows value of LabelNumber to be changed before setting.
  105. /// </summary>
  106. partial void SetLabelNumber(string oldValue, ref string newValue);
  107. /// <summary>
  108. /// When provided in a partial class, allows value of LabelNumber to be changed before returning.
  109. /// </summary>
  110. partial void GetLabelNumber(ref string result);
  111. /// <summary>
  112. /// Max length = 255
  113. /// </summary>
  114. [MaxLength(255)]
  115. [StringLength(255)]
  116. public string LabelNumber
  117. {
  118. get
  119. {
  120. string value = _LabelNumber;
  121. GetLabelNumber(ref value);
  122. return _LabelNumber = value;
  123. }
  124. set
  125. {
  126. string oldValue = _LabelNumber;
  127. SetLabelNumber(oldValue, ref value);
  128. if (oldValue != value)
  129. {
  130. _LabelNumber = value;
  131. }
  132. }
  133. }
  134. /// <summary>
  135. /// Backing field for Country.
  136. /// </summary>
  137. protected string _Country;
  138. /// <summary>
  139. /// When provided in a partial class, allows value of Country to be changed before setting.
  140. /// </summary>
  141. partial void SetCountry(string oldValue, ref string newValue);
  142. /// <summary>
  143. /// When provided in a partial class, allows value of Country to be changed before returning.
  144. /// </summary>
  145. partial void GetCountry(ref string result);
  146. /// <summary>
  147. /// Max length = 2
  148. /// </summary>
  149. [MaxLength(2)]
  150. [StringLength(2)]
  151. public string Country
  152. {
  153. get
  154. {
  155. string value = _Country;
  156. GetCountry(ref value);
  157. return _Country = value;
  158. }
  159. set
  160. {
  161. string oldValue = _Country;
  162. SetCountry(oldValue, ref value);
  163. if (oldValue != value)
  164. {
  165. _Country = value;
  166. }
  167. }
  168. }
  169. /*************************************************************************
  170. * Navigation properties
  171. *************************************************************************/
  172. [ForeignKey("Company_Labels_Id")]
  173. public virtual ICollection<Company> Labels { get; protected set; }
  174. }
  175. }