Преглед на файлове

Made settings classes Unrecoverable

Kenric Nugteren преди 6 месеца
родител
ревизия
f97a9068da
променени са 3 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. 1 0
      InABox.Core/Configuration/GlobalConfiguration.cs
  2. 1 0
      InABox.Core/Configuration/UserConfiguration.cs
  3. 6 0
      InABox.Core/CoreUtils.cs

+ 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
 
     }