# AspireKurrentDBExtensions Methods

- Package: [CommunityToolkit.Aspire.KurrentDB](/reference/api/csharp/communitytoolkit.aspire.kurrentdb.md)
- Type: [AspireKurrentDBExtensions](/reference/api/csharp/communitytoolkit.aspire.kurrentdb/aspirekurrentdbextensions.md)
- Kind: `Methods`
- Members: `2`

Provides extension methods for registering KurrentDB-related services in an `Hosting.IHostApplicationBuilder`.

## AddKeyedKurrentDBClient(IHostApplicationBuilder, string, Action<KurrentDBSettings>)

- Name: `AddKeyedKurrentDBClient(IHostApplicationBuilder, string, Action<KurrentDBSettings>)`
- Modifiers: `extension`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.KurrentDB/AspireKurrentDBExtensions.cs#L48-L51)

Registers `Client.KurrentDBClient` as a keyed singleton for the given `name` in the services provided by the `builder`.

```csharp
public static class AspireKurrentDBExtensions
{
    public static void AddKeyedKurrentDBClient(
        this IHostApplicationBuilder builder,
        string name,
        Action<KurrentDBSettings>? configureSettings = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IHostApplicationBuilder`)
  The `Hosting.IHostApplicationBuilder` to read config from and add services to.
- `name` (`string`)
  The connection name to use to find a connection string.
- `configureSettings` (`Action<KurrentDBSettings>`) `optional`
  An optional method that can be used for customizing the [KurrentDBSettings](/reference/api/csharp/communitytoolkit.aspire.kurrentdb/kurrentdbsettings.md). It's invoked after the settings are read from the configuration.

## AddKurrentDBClient(IHostApplicationBuilder, string, Action<KurrentDBSettings>)

- Name: `AddKurrentDBClient(IHostApplicationBuilder, string, Action<KurrentDBSettings>)`
- Modifiers: `extension`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.KurrentDB/AspireKurrentDBExtensions.cs#L32-L35)

Registers `Client.KurrentDBClient` as a singleton in the services provided by the `builder`.

```csharp
public static class AspireKurrentDBExtensions
{
    public static void AddKurrentDBClient(
        this IHostApplicationBuilder builder,
        string connectionName,
        Action<KurrentDBSettings>? configureSettings = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IHostApplicationBuilder`)
  The `Hosting.IHostApplicationBuilder` to read config from and add services to.
- `connectionName` (`string`)
  The connection name to use to find a connection string.
- `configureSettings` (`Action<KurrentDBSettings>`) `optional`
  An optional method that can be used for customizing the [KurrentDBSettings](/reference/api/csharp/communitytoolkit.aspire.kurrentdb/kurrentdbsettings.md). It's invoked after the settings are read from the configuration.
