public static ILoggingBuilder UseConfiguration(this ILoggingBuilder loggingBuilder, IConfigurationSection configurationSection) { var provider = GetProvider(configurationSection); if (provider == ProviderType.Unknown) { return(loggingBuilder); } // TODO - dynamic call to each of builder switch (provider) { case ProviderType.Log4Net: loggingBuilder.AddLog4Net(); break; case ProviderType.NLog: break; case ProviderType.Serilog: break; default: loggingBuilder.AddDbContext(); break; } return(loggingBuilder); }