/// <summary> /// Gets the <see cref="CommandHandler"/> associated with the specified <paramref name="command"/>. /// </summary> /// <param name="command">The command for which to retrieve a <see cref="CommandHandler"/> instance.</param> public CommandHandler GetHandlerFor(Command command) { Verify.NotNull(command, nameof(command)); CommandHandler commandHandler; Type commandType = command.GetType(); if (!knownCommandHandlers.TryGetValue(commandType, out commandHandler)) throw new MappingException(Exceptions.CommandHandlerNotFound.FormatWith(commandType)); return commandHandler; }