/// <summary> /// Add an environment to the configuration /// </summary> /// <typeparam name="TEnvironment">The environment class to add</typeparam> /// <param name="configurator"></param> /// <param name="environmentFactory">The factory method to create the environment instance</param> public static void Add <TEnvironment>(this IEnvironmentsConfigurator configurator, Func <TEnvironment> environmentFactory) where TEnvironment : class, IServiceBusEnvironment { string environmentName = DefaultTypeNameConvention(typeof(TEnvironment)); // do not collapse or 3.5 won't build configurator.Add(environmentName, environmentFactory); }
/// <summary> /// Add an environment to the configuration /// </summary> /// <typeparam name="TEnvironment">The environment class to add</typeparam> /// <param name="configurator"></param> /// <param name="environment">The environment instance already created and ready to use</param> public static void Add <TEnvironment>(this IEnvironmentsConfigurator configurator, TEnvironment environment) where TEnvironment : class, IServiceBusEnvironment { configurator.Add(() => environment); }
public static void Add(this IEnvironmentsConfigurator configurator, string environmentName, Action <IServiceBusConfigurator> environmentConfigurator) { var environment = new DelegateEnvironmentConfigurator(environmentConfigurator); configurator.Add(environmentName, () => environment); }
/// <summary> /// Add an environment to the configuration /// </summary> /// <typeparam name="TEnvironment">The environment class to add</typeparam> /// <param name="configurator"></param> public static void Add <TEnvironment>(this IEnvironmentsConfigurator configurator) where TEnvironment : class, IServiceBusEnvironment, new() { configurator.Add(() => new TEnvironment()); }