Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Registering the right client
  • Loading branch information
aaronpowell committed Oct 22, 2025
commit cf7b6b037d2cb7c4fcab8d6cd353da663c090d30
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<PackageVersion Include="Aspire.Hosting.MongoDB" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.MySql" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.SqlServer" Version="$(AspireVersion)" />
<PackageVersion Include="KurrentDB.Client" Version="1.0.0" />
</ItemGroup>
<ItemGroup Label="Core Packages">
<!-- AspNetCore packages -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using EventStore.Client;
using EventStore.Client.Extensions.OpenTelemetry;
using HealthChecks.EventStore.gRPC;
using KurrentDB.Client;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
Expand All @@ -31,7 +32,7 @@ public static void AddKurrentDBClient(
Action<KurrentDBSettings>? configureSettings = null)
{
ArgumentNullException.ThrowIfNull(builder);
ArgumentNullException.ThrowIfNullOrEmpty(connectionName);
ArgumentException.ThrowIfNullOrEmpty(connectionName);
AddKurrentDBClient(builder, DefaultConfigSectionName, configureSettings, connectionName, serviceKey: null);
}

Expand All @@ -47,7 +48,7 @@ public static void AddKeyedKurrentDBClient(
Action<KurrentDBSettings>? configureSettings = null)
{
ArgumentNullException.ThrowIfNull(builder);
ArgumentNullException.ThrowIfNullOrEmpty(name);
ArgumentException.ThrowIfNullOrEmpty(name);
AddKurrentDBClient(builder, $"{DefaultConfigSectionName}:{name}", configureSettings, connectionName: name, serviceKey: name);
}

Expand Down Expand Up @@ -97,12 +98,12 @@ private static void AddKurrentDBClient(
timeout: settings.HealthCheckTimeout));
}

EventStoreClient ConfigureKurrentDBClient(IServiceProvider serviceProvider)
KurrentDBClient ConfigureKurrentDBClient(IServiceProvider serviceProvider)
{
if (settings.ConnectionString is not null)
{
var eventStoreClientSettings = EventStoreClientSettings.Create(settings.ConnectionString!);
return new EventStoreClient(eventStoreClientSettings);
var eventStoreClientSettings = KurrentDBClientSettings.Create(settings.ConnectionString!);
return new KurrentDBClient(eventStoreClientSettings);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PackageReference Include="AspNetCore.HealthChecks.EventStore.gRPC" />
<PackageReference Include="EventStore.Client.Extensions.OpenTelemetry" />
<PackageReference Include="EventStore.Client.Grpc.Streams" />
<PackageReference Include="KurrentDB.Client" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
Expand Down
Loading