SeasonMetadata.cs 3.8 KB

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