fixed a bunch of isses with keyed handlers
This commit is contained in:
@@ -3,12 +3,10 @@
|
||||
public class HandlerProvider(SubscriptionCollection subscriptions) :
|
||||
IHandlerProvider
|
||||
{
|
||||
public IEnumerable<object?> Get(Type type,
|
||||
object? key = null)
|
||||
public IEnumerable<object?> Get(object key)
|
||||
{
|
||||
var d = subscriptions;
|
||||
string subscriptionKey = $"{(key is not null ? $"{key}:" : "")}{type}";
|
||||
if (subscriptions.TryGetValue(subscriptionKey, out List<WeakReference>? subscribers))
|
||||
if (subscriptions.TryGetValue(key, out List<WeakReference>? subscribers))
|
||||
{
|
||||
foreach (WeakReference weakRef in subscribers.ToArray())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user