public static void AddConfigurationProvider(this IServiceCollection services, IConfiguration config)
        {
            DefaultConfigLoader loader = new DefaultConfigLoader();

            provider = loader.GetConfigProvider(config);
            services.AddSingleton <DefaultConfigProvider>(provider);
            services.AddTransient <EmailBodyBuilder>();
        }
        public DefaultConfigProvider GetConfigProvider(IConfiguration config)
        {
            DefaultConfigProvider configProvider = new DefaultConfigProvider()
            {
                ConnectionStrings = GetConfiguration <ConnectionStrings>(config, "ConnectionStrings"),
                Logging           = GetConfiguration <Logging>(config, "Logging"),
                STMPConnection    = GetConfiguration <STMPConnection>(config, "STMPConnection"),
                AppSettings       = GetConfiguration <AppSettings>(config, "AppSettings")
            };

            return(configProvider);
        }
 public void ConfigProvider(IServiceCollection services, DefaultConfigProvider provider)
 {
     SetConfiguration <ConnectionStrings>(services, provider.ConnectionStrings);
     SetConfiguration <STMPConnection>(services, provider.STMPConnection);
 }