Example #1
0
        public static DatabaseProvider AddDatabaseProviderSpecificBindings(this IServiceCollection services, IConfigurationSection databaseConfigurationSection)
        {
            services.Configure <DatabaseConfiguration>(databaseConfigurationSection);

            var databaseProviderStr = databaseConfigurationSection.GetValue <string>(nameof(DatabaseConfiguration.Provider));
            var databaseProvider    = DatabaseConfiguration.ConvertDatabaseProvider(databaseProviderStr);

            services.AddDependenciesByDatabaseProvider(databaseProvider);

            return(databaseProvider);
        }