MetadataProvider.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 MetadataProvider
  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 MetadataProvider()
  29. {
  30. Init();
  31. }
  32. /// <summary>
  33. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  34. /// </summary>
  35. public static MetadataProvider CreateMetadataProviderUnsafe()
  36. {
  37. return new MetadataProvider();
  38. }
  39. /// <summary>
  40. /// Public constructor with required data
  41. /// </summary>
  42. /// <param name="name"></param>
  43. public MetadataProvider(string name)
  44. {
  45. if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
  46. this.Name = name;
  47. Init();
  48. }
  49. /// <summary>
  50. /// Static create function (for use in LINQ queries, etc.)
  51. /// </summary>
  52. /// <param name="name"></param>
  53. public static MetadataProvider Create(string name)
  54. {
  55. return new MetadataProvider(name);
  56. }
  57. /*************************************************************************
  58. * Properties
  59. *************************************************************************/
  60. /// <summary>
  61. /// Backing field for Id
  62. /// </summary>
  63. internal int _Id;
  64. /// <summary>
  65. /// When provided in a partial class, allows value of Id to be changed before setting.
  66. /// </summary>
  67. partial void SetId(int oldValue, ref int newValue);
  68. /// <summary>
  69. /// When provided in a partial class, allows value of Id to be changed before returning.
  70. /// </summary>
  71. partial void GetId(ref int result);
  72. /// <summary>
  73. /// Identity, Indexed, Required
  74. /// </summary>
  75. [Key]
  76. [Required]
  77. public int Id
  78. {
  79. get
  80. {
  81. int value = _Id;
  82. GetId(ref value);
  83. return (_Id = value);
  84. }
  85. protected set
  86. {
  87. int oldValue = _Id;
  88. SetId(oldValue, ref value);
  89. if (oldValue != value)
  90. {
  91. _Id = value;
  92. }
  93. }
  94. }
  95. /// <summary>
  96. /// Backing field for Name
  97. /// </summary>
  98. protected string _Name;
  99. /// <summary>
  100. /// When provided in a partial class, allows value of Name to be changed before setting.
  101. /// </summary>
  102. partial void SetName(string oldValue, ref string newValue);
  103. /// <summary>
  104. /// When provided in a partial class, allows value of Name to be changed before returning.
  105. /// </summary>
  106. partial void GetName(ref string result);
  107. /// <summary>
  108. /// Required, Max length = 1024
  109. /// </summary>
  110. [Required]
  111. [MaxLength(1024)]
  112. [StringLength(1024)]
  113. public string Name
  114. {
  115. get
  116. {
  117. string value = _Name;
  118. GetName(ref value);
  119. return (_Name = value);
  120. }
  121. set
  122. {
  123. string oldValue = _Name;
  124. SetName(oldValue, ref value);
  125. if (oldValue != value)
  126. {
  127. _Name = value;
  128. }
  129. }
  130. }
  131. /// <summary>
  132. /// Required
  133. /// </summary>
  134. [ConcurrencyCheck]
  135. [Required]
  136. public byte[] Timestamp { get; set; }
  137. /*************************************************************************
  138. * Navigation properties
  139. *************************************************************************/
  140. }
  141. }