npgsql
npgsql copied to clipboard
Support chaining the mapper configuration
I would like to go:
new NpgsqlDataSourceBuilder(connectionString)
.UseNodaTime() // <-- currently returns INpgsqlTypeMapper
.UseLoggerFactory(logging) // <-- which doesn't work for subsequent chained calls
.Build();
UseNodaTime() returns the interface INpgsqlTypeMapper and not the NpgsqlDataSourceBuilder, which breaks the fluent API here.
This PR uses a generic type constraint to fix this.
@roji any chance of landing this one at some point, given it's a one-liner?
@roji ?
I unfortunately don't have any time to look at PRs at the moment, due to intensive work on the .NET/EF side. Things should be better in September.
This was implemented in #5918 across all plugins