diff --git a/src/Hangfire.PostgreSql.NetCore/PostgreSqlBootstrapperConfigurationExtensions.cs b/src/Hangfire.PostgreSql.NetCore/PostgreSqlBootstrapperConfigurationExtensions.cs index ca51e8f2..60d50a13 100644 --- a/src/Hangfire.PostgreSql.NetCore/PostgreSqlBootstrapperConfigurationExtensions.cs +++ b/src/Hangfire.PostgreSql.NetCore/PostgreSqlBootstrapperConfigurationExtensions.cs @@ -58,5 +58,41 @@ public static PostgreSqlStorage UsePostgreSqlStorage( return storage; } - } + + /// + /// Tells the bootstrapper to use PostgreSQL as a job storage, + /// that can be accessed using the given connection string or + /// its name. + /// + /// Configuration + /// Connection string or its name + public static PostgreSqlStorage UsePostgreSqlStorage( + this IGlobalConfiguration configuration, + string nameOrConnectionString) + { + var storage = new PostgreSqlStorage(nameOrConnectionString); + configuration.UseStorage(storage); + + return storage; + } + + /// + /// Tells the bootstrapper to use PostgreSQL as a job storage + /// with the given options, that can be accessed using the specified + /// connection string or its name. + /// + /// Configuration + /// Connection string or its name + /// Advanced options + public static PostgreSqlStorage UsePostgreSqlStorage( + this IGlobalConfiguration configuration, + string nameOrConnectionString, + PostgreSqlStorageOptions options) + { + var storage = new PostgreSqlStorage(nameOrConnectionString, options); + configuration.UseStorage(storage); + + return storage; + } + } } \ No newline at end of file