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

Added extension method for user configuration

Kenric Nugteren преди 1 година
родител
ревизия
3a68fb6963
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      InABox.Core/Configuration/UserConfiguration.cs

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

@@ -10,6 +10,15 @@ namespace InABox.Configuration
     {
     {
     }
     }
 
 
+    public static class UserConfigurationExtensions
+    {
+        public static void SaveUser<T>(this T settings)
+            where T : IUserConfigurationSettings, new()
+        {
+            new UserConfiguration<T>().Save(settings);
+        }
+    }
+
     [UserTracking(false)]
     [UserTracking(false)]
     public class UserSettings : Entity, IPersistent, IRemotable, ILicense<CoreLicense>
     public class UserSettings : Entity, IPersistent, IRemotable, ILicense<CoreLicense>
     {
     {