public static void AddCommandHandler(Assembly assembly) { var newMapping = HandlerFactoryHelper.CreateHandler <CommandHandlerAttribute>(assembly, typeof(ICommandHandler <>)); _commandToCommandHandlers = _commandToCommandHandlers.Concat(newMapping) .ToDictionary(x => x.Key, x => x.Value); }
public static void AddEventHandler(Assembly assembly) { var newMapping = HandlerFactoryHelper.CreateHandler <EventHandlerAttribute>(assembly, typeof(IEventHandler <>)); _eventToEventHandlers = _eventToEventHandlers.Concat(newMapping) .ToDictionary(x => x.Key, x => x.Value); }