Skip to content

Commit c2eb320

Browse files
authored
Merge pull request #1037 from dco123/MongoResolver
v0: Added overload of `MongoDbOptionsExtensions.ConfigureMongoDb` that passes IResolverContext through to IMongoDatabase factory delegate
2 parents 0af92f3 + 90ecda0 commit c2eb320

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Maintenance release of EventFlow v0 that fixes a few issues and updates dependencies. The update tries to stay as close to the old code base as possible. However, many dependencies have critical vulnerabilities have forced an update. This in turn has again force update on the .NET Framework version for some packages, as the updated dependencies did not support the old ones.
44

55
* Breaking: Updated `Npgsql` from `4.0.2` to `4.1.14` due to critical vulnerability, which have forced `EventFlow.PostgreSql` to from `net452` to `net472`
6+
* New: Added overload of `MongoDbOptionsExtensions.ConfigureMongoDb` that passes IResolverContext through to IMongoDatabase factory delegate
67
* Fix: Updated `System.Data.SqlClient` from `4.3.0` to `4.8.6` due to critical vulnerability
78
* Fix: Updated `Newtonsoft.Json` from `11.0.2` to `13.0.3` due to critical vulnerability
89
* Fix: Updated `Microsoft.Owin` from `3.1.0` to `4.2.2` due to critical vulnerability

Source/EventFlow.MongoDB/Extensions/MongoDbOptionsExtensions.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,17 @@ public static IEventFlowOptions ConfigureMongoDb(
6464
public static IEventFlowOptions ConfigureMongoDb(
6565
this IEventFlowOptions eventFlowOptions,
6666
Func<IMongoDatabase> mongoDatabaseFactory)
67+
{
68+
return eventFlowOptions.ConfigureMongoDb(_ => mongoDatabaseFactory());
69+
}
70+
71+
public static IEventFlowOptions ConfigureMongoDb(
72+
this IEventFlowOptions eventFlowOptions,
73+
Func<IResolverContext, IMongoDatabase> mongoDatabaseFactory)
6774
{
6875
return eventFlowOptions.RegisterServices(sr =>
6976
{
70-
sr.Register(f => mongoDatabaseFactory(), Lifetime.Singleton);
77+
sr.Register(f => mongoDatabaseFactory(f), Lifetime.Singleton);
7178
sr.Register<IReadModelDescriptionProvider, ReadModelDescriptionProvider>(Lifetime.Singleton, true);
7279
sr.Register<IMongoDbEventSequenceStore, MongoDbEventSequenceStore>(Lifetime.Singleton);
7380
});

0 commit comments

Comments
 (0)