예제 #1
0
        public UnitTest1(ITestOutputHelper output)
        {
            _output = output;
            var services = new ServiceCollection();

            services.AddDbContext <MyDbContext>(opt => opt.UseMySql("server=10.0.0.146;Database=demo;Uid=root;Pwd=123456;Port=3306;AllowLoadLocalInfile=true"))
            .AddBatchDB <MyDbContext>();
            _bulk = services.BuildServiceProvider().GetService <ISqlBulk>();
        }
예제 #2
0
파일: SqlBulk.cs 프로젝트: rsnzh/FL.DbBulk
 public SqlBulk(DbContext context, IServiceProvider provider)
 {
     if (context.Database.IsMySql())
     {
         _bulk = provider.GetService <IMysqlBulk>();
     }
     else if (context.Database.IsSqlServer())
     {
         _bulk = provider.GetService <ISqlServerBulk>();
     }
 }