Q:

How can you programatically add mappings to UnicastBusConfig? 

I would like to be able to add subscriptions to additional message types living on potentially different servers to my application at runtime.   What I'm trying to achieve is a Monitoring application where I can add/remove subscriptions at runtime.   Is this possible?   How do I get a reference to the current UnicastBus mappings? 
Here is what I'm doing so far, but I believe this will overwrite any mappings currently in existence. 
MessageEndpointMappingCollection mappings = new MessageEndpointMappingCollection();
mappings. Add(new MessageEndpointMapping()
{
    Messages = m.MessageType. ToString(),
    Endpoint = m.QueueName
});

IComponentConfig<UnicastBusConfig> busConfig = config. Configurer. ConfigureComponent<UnicastBusConfig>(ComponentCallModelEnum. None);
busConfig. ConfigureProperty(u => u.MessageEndpointMappings, mappings);

A:

Yves used this code in his Azure samples (to be found in NSB samples collection)
using NServiceBus. Config;
using NServiceBus. Config. ConfigurationSource;

namespace OrderService
{
    class ConfigOverride : IProvideConfiguration<UnicastBusConfig>
    {
        public UnicastBusConfig GetConfiguration()
        {
            return new UnicastBusConfig
            {
                MessageEndpointMappings = new MessageEndpointMappingCollection
                {
                    new MessageEndpointMapping { Messages="MyMessages", Endpoint="orderserviceinputqueue" }
                }
            };
        }
    }
}

