Пример #1
0
        //private static void AddDbConfiguration(WebHostBuilderContext context, IConfigurationBuilder builder)
        private static void AddDbConfiguration(IConfigurationBuilder builder)
        {
            var configuration    = builder.Build();
            var connectionString = configuration.GetConnectionString("DefaultConnection");

            builder.AddConfigDbProvider(options => options.UseSqlServer(connectionString));
        }
Пример #2
0
        public static IConfigurationBuilder AddDbConfiguration(this IConfigurationBuilder builder)
        {
            var configuration    = builder.Build();
            var connectionString = configuration.GetConnectionString("MainConnection");

            builder.AddConfigDbProvider(options => options.UseNpgsql(connectionString), connectionString);
            return(builder);
        }