RatingSource.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. /// <summary>
  23. /// This is the entity to store review ratings, not age ratings
  24. /// </summary>
  25. public partial class RatingSource
  26. {
  27. partial void Init();
  28. /// <summary>
  29. /// Default constructor. Protected due to required properties, but present because EF needs it.
  30. /// </summary>
  31. protected RatingSource()
  32. {
  33. Init();
  34. }
  35. /// <summary>
  36. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  37. /// </summary>
  38. public static RatingSource CreateRatingSourceUnsafe()
  39. {
  40. return new RatingSource();
  41. }
  42. /// <summary>
  43. /// Public constructor with required data
  44. /// </summary>
  45. /// <param name="maximumvalue"></param>
  46. /// <param name="minimumvalue"></param>
  47. /// <param name="_rating0"></param>
  48. public RatingSource(double maximumvalue, double minimumvalue, global::Jellyfin.Data.Entities.Rating _rating0)
  49. {
  50. this.MaximumValue = maximumvalue;
  51. this.MinimumValue = minimumvalue;
  52. if (_rating0 == null) throw new ArgumentNullException(nameof(_rating0));
  53. _rating0.RatingType = this;
  54. Init();
  55. }
  56. /// <summary>
  57. /// Static create function (for use in LINQ queries, etc.)
  58. /// </summary>
  59. /// <param name="maximumvalue"></param>
  60. /// <param name="minimumvalue"></param>
  61. /// <param name="_rating0"></param>
  62. public static RatingSource Create(double maximumvalue, double minimumvalue, global::Jellyfin.Data.Entities.Rating _rating0)
  63. {
  64. return new RatingSource(maximumvalue, minimumvalue, _rating0);
  65. }
  66. /*************************************************************************
  67. * Properties
  68. *************************************************************************/
  69. /// <summary>
  70. /// Backing field for Id
  71. /// </summary>
  72. internal int _Id;
  73. /// <summary>
  74. /// When provided in a partial class, allows value of Id to be changed before setting.
  75. /// </summary>
  76. partial void SetId(int oldValue, ref int newValue);
  77. /// <summary>
  78. /// When provided in a partial class, allows value of Id to be changed before returning.
  79. /// </summary>
  80. partial void GetId(ref int result);
  81. /// <summary>
  82. /// Identity, Indexed, Required
  83. /// </summary>
  84. [Key]
  85. [Required]
  86. public int Id
  87. {
  88. get
  89. {
  90. int value = _Id;
  91. GetId(ref value);
  92. return (_Id = value);
  93. }
  94. protected set
  95. {
  96. int oldValue = _Id;
  97. SetId(oldValue, ref value);
  98. if (oldValue != value)
  99. {
  100. _Id = value;
  101. }
  102. }
  103. }
  104. /// <summary>
  105. /// Backing field for Name
  106. /// </summary>
  107. protected string _Name;
  108. /// <summary>
  109. /// When provided in a partial class, allows value of Name to be changed before setting.
  110. /// </summary>
  111. partial void SetName(string oldValue, ref string newValue);
  112. /// <summary>
  113. /// When provided in a partial class, allows value of Name to be changed before returning.
  114. /// </summary>
  115. partial void GetName(ref string result);
  116. /// <summary>
  117. /// Max length = 1024
  118. /// </summary>
  119. [MaxLength(1024)]
  120. [StringLength(1024)]
  121. public string Name
  122. {
  123. get
  124. {
  125. string value = _Name;
  126. GetName(ref value);
  127. return (_Name = value);
  128. }
  129. set
  130. {
  131. string oldValue = _Name;
  132. SetName(oldValue, ref value);
  133. if (oldValue != value)
  134. {
  135. _Name = value;
  136. }
  137. }
  138. }
  139. /// <summary>
  140. /// Backing field for MaximumValue
  141. /// </summary>
  142. protected double _MaximumValue;
  143. /// <summary>
  144. /// When provided in a partial class, allows value of MaximumValue to be changed before setting.
  145. /// </summary>
  146. partial void SetMaximumValue(double oldValue, ref double newValue);
  147. /// <summary>
  148. /// When provided in a partial class, allows value of MaximumValue to be changed before returning.
  149. /// </summary>
  150. partial void GetMaximumValue(ref double result);
  151. /// <summary>
  152. /// Required
  153. /// </summary>
  154. [Required]
  155. public double MaximumValue
  156. {
  157. get
  158. {
  159. double value = _MaximumValue;
  160. GetMaximumValue(ref value);
  161. return (_MaximumValue = value);
  162. }
  163. set
  164. {
  165. double oldValue = _MaximumValue;
  166. SetMaximumValue(oldValue, ref value);
  167. if (oldValue != value)
  168. {
  169. _MaximumValue = value;
  170. }
  171. }
  172. }
  173. /// <summary>
  174. /// Backing field for MinimumValue
  175. /// </summary>
  176. protected double _MinimumValue;
  177. /// <summary>
  178. /// When provided in a partial class, allows value of MinimumValue to be changed before setting.
  179. /// </summary>
  180. partial void SetMinimumValue(double oldValue, ref double newValue);
  181. /// <summary>
  182. /// When provided in a partial class, allows value of MinimumValue to be changed before returning.
  183. /// </summary>
  184. partial void GetMinimumValue(ref double result);
  185. /// <summary>
  186. /// Required
  187. /// </summary>
  188. [Required]
  189. public double MinimumValue
  190. {
  191. get
  192. {
  193. double value = _MinimumValue;
  194. GetMinimumValue(ref value);
  195. return (_MinimumValue = value);
  196. }
  197. set
  198. {
  199. double oldValue = _MinimumValue;
  200. SetMinimumValue(oldValue, ref value);
  201. if (oldValue != value)
  202. {
  203. _MinimumValue = value;
  204. }
  205. }
  206. }
  207. /// <summary>
  208. /// Required
  209. /// </summary>
  210. [ConcurrencyCheck]
  211. [Required]
  212. public byte[] Timestamp { get; set; }
  213. /*************************************************************************
  214. * Navigation properties
  215. *************************************************************************/
  216. public virtual global::Jellyfin.Data.Entities.MetadataProviderId Source { get; set; }
  217. }
  218. }