MetadataProviderId.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated from a template.
  4. //
  5. // Manual changes to this file may cause unexpected behavior in your application.
  6. // Manual changes to this file will be overwritten if the code is regenerated.
  7. //
  8. // Produced by Entity Framework Visual Editor
  9. // https://github.com/msawczyn/EFDesigner
  10. // </auto-generated>
  11. //------------------------------------------------------------------------------
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Collections.ObjectModel;
  15. using System.ComponentModel;
  16. using System.ComponentModel.DataAnnotations;
  17. using System.ComponentModel.DataAnnotations.Schema;
  18. using System.Linq;
  19. using System.Runtime.CompilerServices;
  20. namespace Jellyfin.Data.Entities
  21. {
  22. public partial class MetadataProviderId
  23. {
  24. partial void Init();
  25. /// <summary>
  26. /// Default constructor. Protected due to required properties, but present because EF needs it.
  27. /// </summary>
  28. protected MetadataProviderId()
  29. {
  30. // NOTE: This class has one-to-one associations with MetadataProviderId.
  31. // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
  32. Init();
  33. }
  34. /// <summary>
  35. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  36. /// </summary>
  37. public static MetadataProviderId CreateMetadataProviderIdUnsafe()
  38. {
  39. return new MetadataProviderId();
  40. }
  41. /// <summary>
  42. /// Public constructor with required data
  43. /// </summary>
  44. /// <param name="providerid"></param>
  45. /// <param name="_metadata0"></param>
  46. /// <param name="_person1"></param>
  47. /// <param name="_personrole2"></param>
  48. /// <param name="_ratingsource3"></param>
  49. public MetadataProviderId(string providerid, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.Person _person1, global::Jellyfin.Data.Entities.PersonRole _personrole2, global::Jellyfin.Data.Entities.RatingSource _ratingsource3)
  50. {
  51. // NOTE: This class has one-to-one associations with MetadataProviderId.
  52. // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
  53. if (string.IsNullOrEmpty(providerid)) throw new ArgumentNullException(nameof(providerid));
  54. this.ProviderId = providerid;
  55. if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
  56. _metadata0.Sources.Add(this);
  57. if (_person1 == null) throw new ArgumentNullException(nameof(_person1));
  58. _person1.Sources.Add(this);
  59. if (_personrole2 == null) throw new ArgumentNullException(nameof(_personrole2));
  60. _personrole2.Sources.Add(this);
  61. if (_ratingsource3 == null) throw new ArgumentNullException(nameof(_ratingsource3));
  62. _ratingsource3.Source = this;
  63. Init();
  64. }
  65. /// <summary>
  66. /// Static create function (for use in LINQ queries, etc.)
  67. /// </summary>
  68. /// <param name="providerid"></param>
  69. /// <param name="_metadata0"></param>
  70. /// <param name="_person1"></param>
  71. /// <param name="_personrole2"></param>
  72. /// <param name="_ratingsource3"></param>
  73. public static MetadataProviderId Create(string providerid, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.Person _person1, global::Jellyfin.Data.Entities.PersonRole _personrole2, global::Jellyfin.Data.Entities.RatingSource _ratingsource3)
  74. {
  75. return new MetadataProviderId(providerid, _metadata0, _person1, _personrole2, _ratingsource3);
  76. }
  77. /*************************************************************************
  78. * Properties
  79. *************************************************************************/
  80. /// <summary>
  81. /// Backing field for Id
  82. /// </summary>
  83. internal int _Id;
  84. /// <summary>
  85. /// When provided in a partial class, allows value of Id to be changed before setting.
  86. /// </summary>
  87. partial void SetId(int oldValue, ref int newValue);
  88. /// <summary>
  89. /// When provided in a partial class, allows value of Id to be changed before returning.
  90. /// </summary>
  91. partial void GetId(ref int result);
  92. /// <summary>
  93. /// Identity, Indexed, Required
  94. /// </summary>
  95. [Key]
  96. [Required]
  97. public int Id
  98. {
  99. get
  100. {
  101. int value = _Id;
  102. GetId(ref value);
  103. return (_Id = value);
  104. }
  105. protected set
  106. {
  107. int oldValue = _Id;
  108. SetId(oldValue, ref value);
  109. if (oldValue != value)
  110. {
  111. _Id = value;
  112. }
  113. }
  114. }
  115. /// <summary>
  116. /// Backing field for ProviderId
  117. /// </summary>
  118. protected string _ProviderId;
  119. /// <summary>
  120. /// When provided in a partial class, allows value of ProviderId to be changed before setting.
  121. /// </summary>
  122. partial void SetProviderId(string oldValue, ref string newValue);
  123. /// <summary>
  124. /// When provided in a partial class, allows value of ProviderId to be changed before returning.
  125. /// </summary>
  126. partial void GetProviderId(ref string result);
  127. /// <summary>
  128. /// Required, Max length = 255
  129. /// </summary>
  130. [Required]
  131. [MaxLength(255)]
  132. [StringLength(255)]
  133. public string ProviderId
  134. {
  135. get
  136. {
  137. string value = _ProviderId;
  138. GetProviderId(ref value);
  139. return (_ProviderId = value);
  140. }
  141. set
  142. {
  143. string oldValue = _ProviderId;
  144. SetProviderId(oldValue, ref value);
  145. if (oldValue != value)
  146. {
  147. _ProviderId = value;
  148. }
  149. }
  150. }
  151. /// <summary>
  152. /// Required
  153. /// </summary>
  154. [ConcurrencyCheck]
  155. [Required]
  156. public byte[] Timestamp { get; set; }
  157. /*************************************************************************
  158. * Navigation properties
  159. *************************************************************************/
  160. /// <summary>
  161. /// Required
  162. /// </summary>
  163. public virtual global::Jellyfin.Data.Entities.MetadataProvider MetadataProvider { get; set; }
  164. }
  165. }