Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }