Forráskód Böngészése

Fixed problem with BaseStore not being used for unoverriden stores

Kenric Nugteren 6 hónapja
szülő
commit
61169604d3
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      InABox.Database/DbFactory.cs

+ 3 - 1
InABox.Database/DbFactory.cs

@@ -44,6 +44,8 @@ public static class DbFactory
     
     public static string? ColorScheme { get; set; }
     public static byte[]? Logo { get; set; }
+
+    public static Type DefaultStore { get; set; } = typeof(Store<>);
     
     // See notes in Request.DatabaseInfo class
     // Once RPC transport is stable, these settings need
@@ -351,7 +353,7 @@ public static class DbFactory
 
     public static IStore FindStore(Type type, Guid userguid, string userid, Platform platform, string version, Logger logger)
     {
-        var defType = typeof(Store<>).MakeGenericType(type);
+        var defType = DefaultStore.MakeGenericType(type);
         Type? subType = Stores.Where(myType => myType.IsSubclassOf(defType)).FirstOrDefault();
 
         var store = (Activator.CreateInstance(subType ?? defType) as IStore)!;