CustomItemMetadata.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #pragma warning disable CS1591
  2. using System;
  3. namespace Jellyfin.Data.Entities
  4. {
  5. public partial class CustomItemMetadata : Metadata
  6. {
  7. partial void Init();
  8. /// <summary>
  9. /// Default constructor. Protected due to required properties, but present because EF needs it.
  10. /// </summary>
  11. protected CustomItemMetadata()
  12. {
  13. Init();
  14. }
  15. /// <summary>
  16. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  17. /// </summary>
  18. public static CustomItemMetadata CreateCustomItemMetadataUnsafe()
  19. {
  20. return new CustomItemMetadata();
  21. }
  22. /// <summary>
  23. /// Public constructor with required data.
  24. /// </summary>
  25. /// <param name="title">The title or name of the object.</param>
  26. /// <param name="language">ISO-639-3 3-character language codes.</param>
  27. /// <param name="dateadded">The date the object was added.</param>
  28. /// <param name="datemodified">The date the object was last modified.</param>
  29. /// <param name="_customitem0"></param>
  30. public CustomItemMetadata(string title, string language, DateTime dateadded, DateTime datemodified, CustomItem _customitem0)
  31. {
  32. if (string.IsNullOrEmpty(title))
  33. {
  34. throw new ArgumentNullException(nameof(title));
  35. }
  36. this.Title = title;
  37. if (string.IsNullOrEmpty(language))
  38. {
  39. throw new ArgumentNullException(nameof(language));
  40. }
  41. this.Language = language;
  42. if (_customitem0 == null)
  43. {
  44. throw new ArgumentNullException(nameof(_customitem0));
  45. }
  46. _customitem0.CustomItemMetadata.Add(this);
  47. Init();
  48. }
  49. /// <summary>
  50. /// Static create function (for use in LINQ queries, etc.)
  51. /// </summary>
  52. /// <param name="title">The title or name of the object.</param>
  53. /// <param name="language">ISO-639-3 3-character language codes.</param>
  54. /// <param name="dateadded">The date the object was added.</param>
  55. /// <param name="datemodified">The date the object was last modified.</param>
  56. /// <param name="_customitem0"></param>
  57. public static CustomItemMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, CustomItem _customitem0)
  58. {
  59. return new CustomItemMetadata(title, language, dateadded, datemodified, _customitem0);
  60. }
  61. /*************************************************************************
  62. * Properties
  63. *************************************************************************/
  64. /*************************************************************************
  65. * Navigation properties
  66. *************************************************************************/
  67. }
  68. }