public static AppConfigContainer TweakWhen(this AppConfigContainer container, Func <IConfiguration, IConfigurationSection> section, Action <IApplicationBuilder> configuration, string enabledMessage, string disabledMessage = null) => container.TweakWhen(section.Invoke(container.Configuration).Get <bool>(), configuration, enabledMessage, disabledMessage);
public static AppConfigContainer Tweak(this AppConfigContainer container, Action <IApplicationBuilder> configuration, string message) { container.Logger?.LogInformation(message); configuration?.Invoke(container.Builder); return(container); }
public static AppConfigContainer TweakWhen(this AppConfigContainer container, bool condition, Action <IApplicationBuilder> configuration, string enabledMessage, string disabledMessage = null) { if (condition) { container.Tweak(configuration, enabledMessage); } else if (!string.IsNullOrWhiteSpace(disabledMessage)) { container.Logger?.LogInformation(disabledMessage); } return(container); }