Skip to content

Commit

Permalink
Fix NatsConnection factory delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
jasper-d committed Aug 16, 2023
1 parent b40b863 commit cf90739
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NATS.Client.Hosting/NatsHostingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static IServiceCollection AddNats(this IServiceCollection services, int p
services.TryAddTransient<NatsConnection>(static provider =>
{
var pool = provider.GetRequiredService<NatsConnectionPool>();
return pool.GetConnection();
return (pool.GetConnection() as NatsConnection)!;
});

services.TryAddTransient<INatsConnection>(static provider =>
Expand Down

0 comments on commit cf90739

Please sign in to comment.