コード例 #1
0
 private async static Task Insert(List <Importer> importers)
 {
     using (var context = new DataAcces())
     {
         context.Database.SetCommandTimeout(0);
         var bulkConfig = new EFCore.BulkExtensions.BulkConfig
         {
             PreserveInsertOrder = true,
             SetOutputIdentity   = true,
             BatchSize           = int.MaxValue,
             UseTempDB           = false,
             CalculateStats      = true
         };
         await context.BulkInsertAsync(importers, typeof(Importer), bulkConfig, null, default);
     }
 }