SeasonMetadata.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace Jellyfin.Data.Entities
  6. {
  7. public partial class SeasonMetadata : 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 SeasonMetadata()
  14. {
  15. Init();
  16. }
  17. /// <summary>
  18. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  19. /// </summary>
  20. public static SeasonMetadata CreateSeasonMetadataUnsafe()
  21. {
  22. return new SeasonMetadata();
  23. }
  24. /// <summary>
  25. /// Public constructor with required data.
  26. /// </summary>
  27. /// <param name="title">The title or name of the object.</param>
  28. /// <param name="language">ISO-639-3 3-character language codes.</param>
  29. /// <param name="dateadded">The date the object was added.</param>
  30. /// <param name="datemodified">The date the object was last modified.</param>
  31. /// <param name="_season0"></param>
  32. public SeasonMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Season _season0)
  33. {
  34. if (string.IsNullOrEmpty(title))
  35. {
  36. throw new ArgumentNullException(nameof(title));
  37. }
  38. this.Title = title;
  39. if (string.IsNullOrEmpty(language))
  40. {
  41. throw new ArgumentNullException(nameof(language));
  42. }
  43. this.Language = language;
  44. if (_season0 == null)
  45. {
  46. throw new ArgumentNullException(nameof(_season0));
  47. }
  48. _season0.SeasonMetadata.Add(this);
  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="dateadded">The date the object was added.</param>
  57. /// <param name="datemodified">The date the object was last modified.</param>
  58. /// <param name="_season0"></param>
  59. public static SeasonMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Season _season0)
  60. {
  61. return new SeasonMetadata(title, language, dateadded, datemodified, _season0);
  62. }
  63. /*************************************************************************
  64. * Properties
  65. *************************************************************************/
  66. /// <summary>
  67. /// Backing field for Outline.
  68. /// </summary>
  69. protected string _Outline;
  70. /// <summary>
  71. /// When provided in a partial class, allows value of Outline to be changed before setting.
  72. /// </summary>
  73. partial void SetOutline(string oldValue, ref string newValue);
  74. /// <summary>
  75. /// When provided in a partial class, allows value of Outline to be changed before returning.
  76. /// </summary>
  77. partial void GetOutline(ref string result);
  78. /// <summary>
  79. /// Max length = 1024
  80. /// </summary>
  81. [MaxLength(1024)]
  82. [StringLength(1024)]
  83. public string Outline
  84. {
  85. get
  86. {
  87. string value = _Outline;
  88. GetOutline(ref value);
  89. return _Outline = value;
  90. }
  91. set
  92. {
  93. string oldValue = _Outline;
  94. SetOutline(oldValue, ref value);
  95. if (oldValue != value)
  96. {
  97. _Outline = value;
  98. }
  99. }
  100. }
  101. /*************************************************************************
  102. * Navigation properties
  103. *************************************************************************/
  104. }
  105. }