From 740acd7aecd84b99c0f875422689fd8707a221bc Mon Sep 17 00:00:00 2001 From: thomasdc <1496708+thomasdc@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:19:39 +0200 Subject: [PATCH] fix code snippet --- conceptual/Npgsql/security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conceptual/Npgsql/security.md b/conceptual/Npgsql/security.md index 1dcb0d7a..91977df0 100644 --- a/conceptual/Npgsql/security.md +++ b/conceptual/Npgsql/security.md @@ -16,7 +16,7 @@ dataSourceBuilder.UsePeriodicPasswordProvider( (settings, cancellationToken) => /* async code to fetch the new access token */, TimeSpan.FromMinutes(55), // Interval for refreshing the token TimeSpan.FromSeconds(5)); // Interval for retrying after a refresh failure -await using var dataSource = NpgsqlDataSource.Create(connectionString); +await using var dataSource = dataSourceBuilder.Build(); ``` This API allows you to provide a minimal async code fragment for fetching the latest auth token, and have Npgsql take care of running it for you as needed.