private void RegisterAssemblyCommandDestinationMappings(CommandBusConfig commandBusConfig, IEnumerable <Type> commandTypes) { foreach (var mapping in GetCommandEndpointMappingsForAssembly(commandBusConfig.CommandEndpointMappings, commandTypes)) { foreach (var commandType in commandTypes) { if (CommandTypeIsInCommandAssembly(commandType, mapping.Commands)) { commandTypeToDestinationLookup.Add(commandType, mapping.Endpoint); } } } }
private void RegisterCommandDestinationMappings(CommandBusConfig commandBusConfig, IEnumerable <Type> commandTypes) { foreach (var mapping in GetCommandEndpointMappingsForCommand(commandBusConfig.CommandEndpointMappings, commandTypes)) { foreach (var commandType in commandTypes) { if (CommandTypeIsCommand(commandType, mapping.Commands)) { if (commandTypeToDestinationLookup.ContainsKey(commandType)) { commandTypeToDestinationLookup[commandType] = mapping.Endpoint; } else { commandTypeToDestinationLookup.Add(commandType, mapping.Endpoint); } } } } }