public static HandlerMethodsMapping Map(IEnumerable <TypeInfo> commandHandlerObjects) { var mapping = new HandlerMethodsMapping(); foreach (var commandHandler in commandHandlerObjects) { CreateActionDescriptors(commandHandler, mapping); } return(mapping); }
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); } }