Skip to content

Commit f7dfaea

Browse files
committed
Make setup parameter optional in AddPostgresDbContext
Updated the method signature for `AddPostgresDbContext<TContext>` to make the `setup` parameter optional by providing a default value of `null`. This enhancement allows the method to be called without explicitly passing a setup action, improving usability.
1 parent 47ddd9c commit f7dfaea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/EasyExtensions.EntityFrameworkCore.Npgsql/Extensions/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static class ServiceCollectionExtensions
2424
/// <returns> Current <see cref="IServiceCollection"/> instance. </returns>
2525
/// <exception cref="KeyNotFoundException"> When DatabaseSettings section is not set. </exception>
2626
public static IServiceCollection AddPostgresDbContext<TContext>(this IServiceCollection services,
27-
IConfiguration configuration, Action<PostgresContextFactory>? setup) where TContext : DbContext
27+
IConfiguration configuration, Action<PostgresContextFactory>? setup = null) where TContext : DbContext
2828
{
2929
PostgresContextFactory contextFactory = new();
3030
setup?.Invoke(contextFactory);

0 commit comments

Comments
 (0)