Skip to content

Commit 38d69cc

Browse files
authored
fix(besql): resolve lock issues during in-app migration #10204 (#10208)
1 parent 001acb6 commit 38d69cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Besql/Bit.Besql/IServiceCollectionBesqlExtentions.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ public static IServiceCollection AddBesqlDbContextFactory<TDbContext>(this IServ
5252
else
5353
{
5454
services.TryAddSingleton<IBitBesqlStorage, BitBesqlNoopStoage>();
55-
services.AddDbContextFactory<TDbContext, PooledDbContextFactoryBase<TDbContext>>(optionsAction);
55+
services.AddDbContextFactory<TDbContext, PooledDbContextFactoryBase<TDbContext>>((serviceProvider, options) =>
56+
{
57+
#if NET9_0_OR_GREATER
58+
options.ReplaceService<IHistoryRepository, BesqlHistoryRepository>();
59+
#endif
60+
optionsAction.Invoke(serviceProvider, options);
61+
});
5662
}
5763

5864
return services;

0 commit comments

Comments
 (0)