PhotoMetadata.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. namespace Jellyfin.Data.Entities
  5. {
  6. public partial class PhotoMetadata : 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 PhotoMetadata()
  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 PhotoMetadata CreatePhotoMetadataUnsafe()
  20. {
  21. return new PhotoMetadata();
  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="dateadded">The date the object was added.</param>
  29. /// <param name="datemodified">The date the object was last modified.</param>
  30. /// <param name="_photo0"></param>
  31. public PhotoMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Photo _photo0)
  32. {
  33. if (string.IsNullOrEmpty(title))
  34. {
  35. throw new ArgumentNullException(nameof(title));
  36. }
  37. this.Title = title;
  38. if (string.IsNullOrEmpty(language))
  39. {
  40. throw new ArgumentNullException(nameof(language));
  41. }
  42. this.Language = language;
  43. if (_photo0 == null)
  44. {
  45. throw new ArgumentNullException(nameof(_photo0));
  46. }
  47. _photo0.PhotoMetadata.Add(this);
  48. Init();
  49. }
  50. /// <summary>
  51. /// Static create function (for use in LINQ queries, etc.)
  52. /// </summary>
  53. /// <param name="title">The title or name of the object.</param>
  54. /// <param name="language">ISO-639-3 3-character language codes.</param>
  55. /// <param name="dateadded">The date the object was added.</param>
  56. /// <param name="datemodified">The date the object was last modified.</param>
  57. /// <param name="_photo0"></param>
  58. public static PhotoMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Photo _photo0)
  59. {
  60. return new PhotoMetadata(title, language, dateadded, datemodified, _photo0);
  61. }
  62. /*************************************************************************
  63. * Properties
  64. *************************************************************************/
  65. /*************************************************************************
  66. * Navigation properties
  67. *************************************************************************/
  68. }
  69. }