예제 #1
0
        public static HandlerMethodsMapping Map(IEnumerable <TypeInfo> commandHandlerObjects)
        {
            var mapping = new HandlerMethodsMapping();

            foreach (var commandHandler in commandHandlerObjects)
            {
                CreateActionDescriptors(commandHandler, mapping);
            }
            return(mapping);
        }
예제 #2
0
        private static void CreateActionDescriptors(TypeInfo commandHandler, HandlerMethodsMapping methodsMapping)
        {
            var commandHandlerDescriptor = new HandlerParentObjectDescriptor(commandHandler);
            var actionHandlers           = GetHandlerForCommandHandler(commandHandler);

            foreach (var actionHandler in actionHandlers)
            {
                var(commandType, descriptor) = CreateActionDescriptor(actionHandler, commandHandlerDescriptor);
                commandHandlerDescriptor.AddActionDescriptor(descriptor);
                methodsMapping.Add(commandType, descriptor);
            }
        }