public Dispatcher( IServiceProvider serviceProvider, DispatcherContext context ) { _serviceProvider = serviceProvider; _context = context; }
public static DispatcherContext AddHandler(this DispatcherContext context, string topic, Type handlerType) { if (!context.HandlersByTopic.ContainsKey(topic)) { context.HandlersByTopic.Add(topic, new List <Type>()); } if (!context.HandlersByTopic[topic].Contains(handlerType)) { context.HandlersByTopic[topic].Add(handlerType); } return(context); }