public IDictionary<Type, Address> Configure(Action<MessageEndpointMapping> setupMapping) { var mappings = new Dictionary<Type, Address>(); var mapping = new MessageEndpointMapping{ Endpoint = "SomeEndpoint" }; setupMapping(mapping); mapping.Configure((t, a) => mappings[t] = a); return mappings; }