Preference.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated from a template.
  4. //
  5. // Manual changes to this file may cause unexpected behavior in your application.
  6. // Manual changes to this file will be overwritten if the code is regenerated.
  7. //
  8. // Produced by Entity Framework Visual Editor
  9. // https://github.com/msawczyn/EFDesigner
  10. // </auto-generated>
  11. //------------------------------------------------------------------------------
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Collections.ObjectModel;
  15. using System.ComponentModel;
  16. using System.ComponentModel.DataAnnotations;
  17. using System.ComponentModel.DataAnnotations.Schema;
  18. using System.Linq;
  19. using System.Runtime.CompilerServices;
  20. namespace Jellyfin.Data.Entities
  21. {
  22. public partial class Preference
  23. {
  24. partial void Init();
  25. /// <summary>
  26. /// Default constructor. Protected due to required properties, but present because EF needs it.
  27. /// </summary>
  28. protected Preference()
  29. {
  30. Init();
  31. }
  32. /// <summary>
  33. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  34. /// </summary>
  35. public static Preference CreatePreferenceUnsafe()
  36. {
  37. return new Preference();
  38. }
  39. /// <summary>
  40. /// Public constructor with required data
  41. /// </summary>
  42. /// <param name="kind"></param>
  43. /// <param name="value"></param>
  44. /// <param name="_user0"></param>
  45. /// <param name="_group1"></param>
  46. public Preference(global::Jellyfin.Data.Enums.PreferenceKind kind, string value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1)
  47. {
  48. this.Kind = kind;
  49. if (string.IsNullOrEmpty(value)) throw new ArgumentNullException(nameof(value));
  50. this.Value = value;
  51. if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
  52. _user0.Preferences.Add(this);
  53. if (_group1 == null) throw new ArgumentNullException(nameof(_group1));
  54. _group1.Preferences.Add(this);
  55. Init();
  56. }
  57. /// <summary>
  58. /// Static create function (for use in LINQ queries, etc.)
  59. /// </summary>
  60. /// <param name="kind"></param>
  61. /// <param name="value"></param>
  62. /// <param name="_user0"></param>
  63. /// <param name="_group1"></param>
  64. public static Preference Create(global::Jellyfin.Data.Enums.PreferenceKind kind, string value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1)
  65. {
  66. return new Preference(kind, value, _user0, _group1);
  67. }
  68. /*************************************************************************
  69. * Properties
  70. *************************************************************************/
  71. /// <summary>
  72. /// Identity, Indexed, Required
  73. /// </summary>
  74. [Key]
  75. [Required]
  76. public int Id { get; protected set; }
  77. /// <summary>
  78. /// Required
  79. /// </summary>
  80. [Required]
  81. public global::Jellyfin.Data.Enums.PreferenceKind Kind { get; set; }
  82. /// <summary>
  83. /// Required, Max length = 65535
  84. /// </summary>
  85. [Required]
  86. [MaxLength(65535)]
  87. [StringLength(65535)]
  88. public string Value { get; set; }
  89. /// <summary>
  90. /// Concurrency token
  91. /// </summary>
  92. [Timestamp]
  93. public Byte[] Timestamp { get; set; }
  94. /*************************************************************************
  95. * Navigation properties
  96. *************************************************************************/
  97. }
  98. }