Esempio n. 1
0
        public async Task BulkInsertAsync <T>(IList <T> entities, CancellationToken cancellationToken = default) where T : class
        {
            // cosmos db and inmemory does not allow bulk insert
            if (this.Database.IsCosmos() || this.Database.IsInMemory())
            {
                Set <T>().AddRange(entities);

                await SaveChangesAsync(cancellationToken);
            }
            else
            {
                await DbContextBulkExtensions.BulkInsertAsync <T>(this, entities);
            }
        }
Esempio n. 2
0
 public async Task BulkInsertAsync <T>(IList <T> entities) where T : class
 {
     await DbContextBulkExtensions.BulkInsertAsync(this, entities);
 }
Esempio n. 3
0
 public Task BulkInsertAsync <TEntity>(IList <TEntity> entities) where TEntity : class
 {
     return(DbContextBulkExtensions.BulkInsertAsync(this, entities));
 }