CustomItemMetadata.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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)) throw new ArgumentNullException(nameof(title));
  30. this.Title = title;
  31. if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
  32. this.Language = language;
  33. if (_customitem0 == null) throw new ArgumentNullException(nameof(_customitem0));
  34. _customitem0.CustomItemMetadata.Add(this);
  35. Init();
  36. }
  37. /// <summary>
  38. /// Static create function (for use in LINQ queries, etc.)
  39. /// </summary>
  40. /// <param name="title">The title or name of the object</param>
  41. /// <param name="language">ISO-639-3 3-character language codes</param>
  42. /// <param name="_customitem0"></param>
  43. public static CustomItemMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, CustomItem _customitem0)
  44. {
  45. return new CustomItemMetadata(title, language, dateadded, datemodified, _customitem0);
  46. }
  47. /*************************************************************************
  48. * Properties
  49. *************************************************************************/
  50. /*************************************************************************
  51. * Navigation properties
  52. *************************************************************************/
  53. }
  54. }