From 9015e08518f22dbf96d3ecfe317322a54345e971 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 9 Jul 2022 15:04:21 +0200 Subject: [PATCH] Changed database at the DI system to be transient --- I18N Commander/DataModel/Setup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/I18N Commander/DataModel/Setup.cs b/I18N Commander/DataModel/Setup.cs index 44e32d8..ed1388d 100644 --- a/I18N Commander/DataModel/Setup.cs +++ b/I18N Commander/DataModel/Setup.cs @@ -30,7 +30,7 @@ public static class Setup /// public static void AddDatabase(this IServiceCollection serviceCollection, string path2DataFile, bool createWhenNecessary = true) { - serviceCollection.AddDbContext(options => options.UseSqlite($"Filename={path2DataFile};Mode={(createWhenNecessary ? DB_READ_WRITE_CREATE_MODE : DB_READ_WRITE_MODE)}")); + serviceCollection.AddDbContext(options => options.UseSqlite($"Filename={path2DataFile};Mode={(createWhenNecessary ? DB_READ_WRITE_CREATE_MODE : DB_READ_WRITE_MODE)}"), ServiceLifetime.Transient); } ///