SeasonMetadata.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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)) throw new ArgumentNullException(nameof(title));
  32. this.Title = title;
  33. if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
  34. this.Language = language;
  35. if (_season0 == null) throw new ArgumentNullException(nameof(_season0));
  36. _season0.SeasonMetadata.Add(this);
  37. Init();
  38. }
  39. /// <summary>
  40. /// Static create function (for use in LINQ queries, etc.)
  41. /// </summary>
  42. /// <param name="title">The title or name of the object</param>
  43. /// <param name="language">ISO-639-3 3-character language codes</param>
  44. /// <param name="_season0"></param>
  45. public static SeasonMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Season _season0)
  46. {
  47. return new SeasonMetadata(title, language, dateadded, datemodified, _season0);
  48. }
  49. /*************************************************************************
  50. * Properties
  51. *************************************************************************/
  52. /// <summary>
  53. /// Backing field for Outline
  54. /// </summary>
  55. protected string _Outline;
  56. /// <summary>
  57. /// When provided in a partial class, allows value of Outline to be changed before setting.
  58. /// </summary>
  59. partial void SetOutline(string oldValue, ref string newValue);
  60. /// <summary>
  61. /// When provided in a partial class, allows value of Outline to be changed before returning.
  62. /// </summary>
  63. partial void GetOutline(ref string result);
  64. /// <summary>
  65. /// Max length = 1024
  66. /// </summary>
  67. [MaxLength(1024)]
  68. [StringLength(1024)]
  69. public string Outline
  70. {
  71. get
  72. {
  73. string value = _Outline;
  74. GetOutline(ref value);
  75. return (_Outline = value);
  76. }
  77. set
  78. {
  79. string oldValue = _Outline;
  80. SetOutline(oldValue, ref value);
  81. if (oldValue != value)
  82. {
  83. _Outline = value;
  84. }
  85. }
  86. }
  87. /*************************************************************************
  88. * Navigation properties
  89. *************************************************************************/
  90. }
  91. }