Group.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 Group
  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 Group()
  29. {
  30. GroupPermissions = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Permission>();
  31. ProviderMappings = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.ProviderMapping>();
  32. Preferences = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Preference>();
  33. Init();
  34. }
  35. /// <summary>
  36. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  37. /// </summary>
  38. public static Group CreateGroupUnsafe()
  39. {
  40. return new Group();
  41. }
  42. /// <summary>
  43. /// Public constructor with required data
  44. /// </summary>
  45. /// <param name="name"></param>
  46. /// <param name="_user0"></param>
  47. public Group(string name, global::Jellyfin.Data.Entities.User _user0)
  48. {
  49. if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
  50. this.Name = name;
  51. if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
  52. _user0.Groups.Add(this);
  53. this.GroupPermissions = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Permission>();
  54. this.ProviderMappings = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.ProviderMapping>();
  55. this.Preferences = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Preference>();
  56. Init();
  57. }
  58. /// <summary>
  59. /// Static create function (for use in LINQ queries, etc.)
  60. /// </summary>
  61. /// <param name="name"></param>
  62. /// <param name="_user0"></param>
  63. public static Group Create(string name, global::Jellyfin.Data.Entities.User _user0)
  64. {
  65. return new Group(name, _user0);
  66. }
  67. /*************************************************************************
  68. * Properties
  69. *************************************************************************/
  70. /// <summary>
  71. /// Identity, Indexed, Required
  72. /// </summary>
  73. [Key]
  74. [Required]
  75. public int Id { get; protected set; }
  76. /// <summary>
  77. /// Required, Max length = 255
  78. /// </summary>
  79. [Required]
  80. [MaxLength(255)]
  81. [StringLength(255)]
  82. public string Name { get; set; }
  83. /// <summary>
  84. /// Concurrency token
  85. /// </summary>
  86. [Timestamp]
  87. public Byte[] Timestamp { get; set; }
  88. /*************************************************************************
  89. * Navigation properties
  90. *************************************************************************/
  91. public virtual ICollection<global::Jellyfin.Data.Entities.Permission> GroupPermissions { get; protected set; }
  92. public virtual ICollection<global::Jellyfin.Data.Entities.ProviderMapping> ProviderMappings { get; protected set; }
  93. public virtual ICollection<global::Jellyfin.Data.Entities.Preference> Preferences { get; protected set; }
  94. }
  95. }