Browse Source

Setting DefaultStore for DbFactory

Kenric Nugteren 5 months ago
parent
commit
49c06707a5

+ 1 - 0
prs.desktop/MainWindow.xaml.cs

@@ -1566,6 +1566,7 @@ public partial class MainWindow : IPanelHostControl
                 && !myType.IsGenericType
                 && myType.GetInterfaces().Contains(typeof(IStore))
         ).ToArray();
+        DbFactory.DefaultStore = typeof(BaseStore<>);
 
         DbFactory.ProviderFactory = new SQLiteProviderFactory(App.DatabaseSettings.FileName);
         DbFactory.ColorScheme = App.DatabaseSettings.ColorScheme;

+ 1 - 0
prs.server/Engines/Database/DatabaseEngine.cs

@@ -166,6 +166,7 @@ public class DatabaseEngine : Engine<DatabaseServerProperties>
                 myType is { IsClass: true, IsAbstract: false, IsGenericType: false } 
                 && myType.GetInterfaces().Contains(typeof(IStore))
         ).ToArray();
+        DbFactory.DefaultStore = typeof(BaseStore<>);
 
         DbFactory.ProviderFactory = new SQLiteProviderFactory(Properties.FileName);
 

+ 1 - 0
prs.server/Forms/ServerGrid.cs

@@ -1144,6 +1144,7 @@ public class ServerGrid : DynamicGrid<Server>
                             && !myType.IsGenericType
                             && myType.GetInterfaces().Contains(typeof(IStore))
                     ).ToArray();
+                    DbFactory.DefaultStore = typeof(BaseStore<>);
 
                     DbFactory.ProviderFactory = new SQLiteProviderFactory(properties.FileName);
                     DbFactory.Start();