public void AddSubscriber(Type messageType, QueueName destination) { Condition.Requires(messageType, "messageType").IsNotNull(); Condition.Requires(destination, "destination").IsNotNull(); SubscriptionRegistration registration; if (!Subscriptions.TryGet(messageType, out registration)) registration = new SubscriptionRegistration(); if (!registration.SubscriberQueueNames.Any(q => q == destination)) registration.SubscriberQueueNames.Add(destination.Name); Subscriptions.Put(messageType, registration); }
public void AddSubscriber(Type messageType, QueueName destination) { Condition.Requires(messageType, "messageType").IsNotNull(); Condition.Requires(destination, "destination").IsNotNull(); SubscriptionRegistration registration; if (!Subscriptions.TryGet(messageType, out registration)) { registration = new SubscriptionRegistration(); } if (!registration.SubscriberQueueNames.Any(q => q == destination)) { registration.SubscriberQueueNames.Add(destination.Name); } Subscriptions.Put(messageType, registration); }