CustomItemMetadata.cs 2.6 KB

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