From 617df5e0e6622b564481dc95601175e9608882bb Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 1 Sep 2020 11:04:32 -0400 Subject: [PATCH] Clean up and document Permission.cs --- Jellyfin.Data/Entities/Permission.cs | 36 ++-------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/Jellyfin.Data/Entities/Permission.cs b/Jellyfin.Data/Entities/Permission.cs index c0f67f8363..d92e5d9d25 100644 --- a/Jellyfin.Data/Entities/Permission.cs +++ b/Jellyfin.Data/Entities/Permission.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Jellyfin.Data.Enums; @@ -10,7 +8,7 @@ namespace Jellyfin.Data.Entities /// /// An entity representing whether the associated user has a specific permission. /// - public partial class Permission : IHasConcurrencyToken + public class Permission : IHasConcurrencyToken { /// /// Initializes a new instance of the class. @@ -22,8 +20,6 @@ namespace Jellyfin.Data.Entities { Kind = kind; Value = value; - - Init(); } /// @@ -32,21 +28,14 @@ namespace Jellyfin.Data.Entities /// protected Permission() { - Init(); } - /************************************************************************* - * Properties - *************************************************************************/ - /// /// Gets or sets the id of this permission. /// /// /// Identity, Indexed, Required. /// - [Key] - [Required] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; protected set; } @@ -56,7 +45,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public PermissionKind Kind { get; protected set; } /// @@ -65,36 +53,16 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool Value { get; set; } - /// - /// Gets or sets the row version. - /// - /// - /// Required, ConcurrencyToken. - /// + /// [ConcurrencyCheck] - [Required] public uint RowVersion { get; set; } - /// - /// Static create function (for use in LINQ queries, etc.) - /// - /// The permission kind. - /// The value of this permission. - /// The newly created instance. - public static Permission Create(PermissionKind kind, bool value) - { - return new Permission(kind, value); - } - /// public void OnSavingChanges() { RowVersion++; } - - partial void Init(); } }