Skip to content

Commit ae22240

Browse files
authored
Update README.md
1 parent 495ec00 commit ae22240

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ In `Startup.cs` _ConfigureServices(IServiceCollection services)_ method add the
3535

3636
```csharp
3737
services.AddHangfire(config =>
38-
config.UsePostgreSqlStorage(Configuration.GetConnectionString("HangfireConnection")));
38+
config.UsePostgreSqlStorage(c =>
39+
c.UseNpgsqlConnection(Configuration.GetConnectionString("HangfireConnection"))));
3940
```
4041

4142
In Configure method, add these two lines:
@@ -54,16 +55,17 @@ If you encounter any issues/bugs or have idea of a feature regarding Hangfire.Po
5455
SSL support can be enabled for Hangfire.PostgreSql library using the following mechanism:
5556

5657
```csharp
57-
config.UsePostgreSqlStorage(
58-
Configuration.GetConnectionString("HangfireConnection"), // connection string
59-
connection => // connection setup - gets called after instantiating the connection and before any calls to DB are made
60-
{
61-
connection.ProvideClientCertificatesCallback += clientCerts =>
58+
config.UsePostgreSqlStorage(c =>
59+
c.UseNpgsqlConnection(
60+
Configuration.GetConnectionString("HangfireConnection"), // connection string,
61+
connection => // connection setup - gets called after instantiating the connection and before any calls to DB are made
6262
{
63-
clientCerts.Add(X509Certificate.CreateFromCertFile("[CERT_FILENAME]"));
64-
};
65-
},
66-
new PostgreSqlStorageOptions() // no overload without options, so just pass the default or configured options
63+
connection.ProvideClientCertificatesCallback += clientCerts =>
64+
{
65+
clientCerts.Add(X509Certificate.CreateFromCertFile("[CERT_FILENAME]"));
66+
};
67+
}
68+
)
6769
);
6870
```
6971

0 commit comments

Comments
 (0)