Skip to content

Commit

Permalink
Fix link to Keyed Services documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Dec 19, 2024
1 parent ce10e20 commit 44fc7df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/content/diagnostics/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ builder.Services.AddMySqlDataSource(builder.Configuration.GetConnectionString("D

### Keyed Services

Use the `AddKeyedMySqlDataSource` method to register a `MySqlDataSource` as a [keyed service](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#keyed-di-services).
Use the `AddKeyedMySqlDataSource` method to register a `MySqlDataSource` as a [keyed service](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8/runtime#keyed-di-services).
If the service key is a string, it will automatically be used as the `MySqlDataSource` name.

```csharp
Expand Down
2 changes: 1 addition & 1 deletion src/MySqlConnector.DependencyInjection/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ builder.Services.AddMySqlDataSource("Server=server;User ID=test;Password=test;Da

## Keyed Services

Use the `AddKeyedMySqlDataSource` method to register a `MySqlDataSource` as a [keyed service](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#keyed-di-services).
Use the `AddKeyedMySqlDataSource` method to register a `MySqlDataSource` as a [keyed service](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8/runtime#keyed-di-services).
This is useful if you have multiple connection strings or need to connect to multiple databases.
If the service key is a string, it will automatically be used as the `MySqlDataSource` name;
to customize this, call the `AddKeyedMySqlDataSource(object?, string, Action<MySqlDataSourceBuilder>)` overload and call `MySqlDataSourceBuilder.UseName`.
Expand Down

0 comments on commit 44fc7df

Please sign in to comment.