Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0: Added overload of MongoDbOptionsExtensions.ConfigureMongoDb that passes IResolverContext through to IMongoDatabase factory delegate #1037

Merged
merged 3 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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.

* 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`
* New: Added overload of `MongoDbOptionsExtensions.ConfigureMongoDb` that passes IResolverContext through to IMongoDatabase factory delegate
* Fix: Updated `System.Data.SqlClient` from `4.3.0` to `4.8.6` due to critical vulnerability
* Fix: Updated `Newtonsoft.Json` from `11.0.2` to `13.0.3` due to critical vulnerability
* Fix: Updated `Microsoft.Owin` from `3.1.0` to `4.2.2` due to critical vulnerability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,17 @@ public static IEventFlowOptions ConfigureMongoDb(
public static IEventFlowOptions ConfigureMongoDb(
this IEventFlowOptions eventFlowOptions,
Func<IMongoDatabase> mongoDatabaseFactory)
{
return eventFlowOptions.ConfigureMongoDb(_ => mongoDatabaseFactory());
}

public static IEventFlowOptions ConfigureMongoDb(
this IEventFlowOptions eventFlowOptions,
Func<IResolverContext, IMongoDatabase> mongoDatabaseFactory)
{
return eventFlowOptions.RegisterServices(sr =>
{
sr.Register(f => mongoDatabaseFactory(), Lifetime.Singleton);
sr.Register(f => mongoDatabaseFactory(f), Lifetime.Singleton);
sr.Register<IReadModelDescriptionProvider, ReadModelDescriptionProvider>(Lifetime.Singleton, true);
sr.Register<IMongoDbEventSequenceStore, MongoDbEventSequenceStore>(Lifetime.Singleton);
});
Expand Down