From d201fdbb1f96f80220b6ccb818b4eb0d05a41924 Mon Sep 17 00:00:00 2001 From: "Frank R. Haugen" Date: Fri, 2 Feb 2024 11:07:49 +0100 Subject: [PATCH] Update ChannelFactory.cs --- Frank.Channels.DependencyInjection/ChannelFactory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frank.Channels.DependencyInjection/ChannelFactory.cs b/Frank.Channels.DependencyInjection/ChannelFactory.cs index 29f470a..2508ad6 100644 --- a/Frank.Channels.DependencyInjection/ChannelFactory.cs +++ b/Frank.Channels.DependencyInjection/ChannelFactory.cs @@ -7,7 +7,7 @@ public class ChannelFactory : IChannelFactory { private readonly ConcurrentDictionary _cache = new(); - public Channel CreateChannel() where T : class => _cache.GetOrAdd(nameof(T), Value) as Channel ?? throw new InvalidOperationException($"{nameof(Channel)} not found"); + public Channel CreateChannel() where T : class => _cache.GetOrAdd(typeof(T).Name, Value) as Channel ?? throw new InvalidOperationException($"Channel<{typeof(T).Name}> not found"); private static Channel Value(string arg) where T : class => Channel.CreateUnbounded(new UnboundedChannelOptions() @@ -15,4 +15,4 @@ private static Channel Value(string arg) where T : class => SingleReader = true, SingleWriter = true }); -} \ No newline at end of file +}