npgsql icon indicating copy to clipboard operation
npgsql copied to clipboard

Support chaining the mapper configuration

Open herebebeasties opened this issue 3 years ago • 3 comments

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.

herebebeasties avatar Nov 10 '22 14:11 herebebeasties

@roji any chance of landing this one at some point, given it's a one-liner?

herebebeasties avatar May 01 '23 16:05 herebebeasties

@roji ?

herebebeasties avatar Jul 14 '23 10:07 herebebeasties

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.

roji avatar Jul 14 '23 12:07 roji

This was implemented in #5918 across all plugins

NinoFloris avatar Oct 29 '25 14:10 NinoFloris