CompanyMetadata.cs 7.0 KB

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