Skip to content

Commit b2d1e5f

Browse files
bugfix: factory is supposed to be singleton
omega oof.
1 parent 04119bd commit b2d1e5f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/EntityDb.MongoDb/Extensions/IServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static void AddMongoDbTransactions<TEntity>(this IServiceCollection servi
2626
string databaseName, Func<IConfiguration, string> getConnectionString,
2727
bool testMode = false)
2828
{
29-
serviceCollection.AddScoped<ITransactionRepositoryFactory<TEntity>>(serviceProvider =>
29+
serviceCollection.AddSingleton<ITransactionRepositoryFactory<TEntity>>(serviceProvider =>
3030
{
3131
var configuration = serviceProvider.GetRequiredService<IConfiguration>();
3232

src/EntityDb.Void/Extensions/IServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static class IServiceCollectionExtensions
2121
public static void AddVoidTransactions<TEntity>(this IServiceCollection serviceCollection)
2222
{
2323
serviceCollection
24-
.AddScoped<ITransactionRepositoryFactory<TEntity>, VoidTransactionRepositoryFactory<TEntity>>();
24+
.AddSingleton<ITransactionRepositoryFactory<TEntity>, VoidTransactionRepositoryFactory<TEntity>>();
2525
}
2626
}
2727
}

0 commit comments

Comments
 (0)