Browse Source

Made settings classes Unrecoverable

Kenric Nugteren 6 months ago
parent
commit
f97a9068da

+ 1 - 0
InABox.Core/Configuration/GlobalConfiguration.cs

@@ -10,6 +10,7 @@ namespace InABox.Configuration
     }
 
     [UserTracking(false)]
+    [Unrecoverable]
     public class GlobalSettings : Entity, IPersistent, IRemotable, ILicense<CoreLicense>
     {
         public string Section { get; set; } = "";

+ 1 - 0
InABox.Core/Configuration/UserConfiguration.cs

@@ -19,6 +19,7 @@ namespace InABox.Configuration
     }
 
     [UserTracking(false)]
+    [Unrecoverable]
     public class UserSettings : Entity, IPersistent, IRemotable, ILicense<CoreLicense>
     {
         public string Section { get; set; }

+ 6 - 0
InABox.Core/CoreUtils.cs

@@ -2728,6 +2728,12 @@ namespace InABox.Core
             return new Queue<T>(enumerable.ToArray());
         }
 
+        public static void SortBy<T, TProp>(this List<T> list, Func<T, TProp> comparison)
+            where TProp : IComparable
+        {
+            list.Sort((a, b) => comparison(a).CompareTo(comparison(b)));
+        }
+
         #endregion
 
     }