Skip to content

Conversation

NinoFloris
Copy link
Member

Closes #4822

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

One unrelated thought while reviewing this, is that we have no overloads which don't require a connection string. It's already possible to configure things entirely via NpgsqlDataSourceBuilder, so it may make sense to allow users to do AddNpgsqlDataSource with only a NpgsqlDataSourceBuilder lambda (with/without IServiceProvider). On the other hand, yet more overloads :/

Could be part of the more general push towards a connstring-less experience...

/// Defaults to <see cref="ServiceLifetime.Singleton" />.
/// </param>
/// <returns>The same service collection so that multiple calls can be chained.</returns>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Defined for binary compatibility with 7.0")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I heard it didn't pan out. They're going for a much more general mechanism now dotnet/csharplang#7706

@NinoFloris NinoFloris merged commit cb9d849 into main Mar 16, 2024
@NinoFloris NinoFloris deleted the add-di-arg-methods branch March 16, 2024 17:24
NinoFloris added a commit that referenced this pull request Mar 16, 2024
@NinoFloris
Copy link
Member Author

Backported to 8.0.3 via cb9d849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependency Injection method that takes an action with an IServiceProvider parameter
3 participants