예제 #1
0
 private async Task loadDocumentsAsync <T>(IReadOnlyCollection <T> documents, IBulkLoader <T> loader, BulkInsertMode mode, NpgsqlConnection conn, CancellationToken cancellation)
 {
     if (mode == BulkInsertMode.InsertsOnly)
     {
         await loader.LoadAsync(_tenant, Serializer, conn, documents, cancellation).ConfigureAwait(false);
     }
     else
     {
         await loader.LoadIntoTempTableAsync(_tenant, Serializer, conn, documents, cancellation).ConfigureAwait(false);
     }
 }
예제 #2
0
 public Task LoadIntoTempTableAsync(ITenant tenant, ISerializer serializer, NpgsqlConnection conn, IEnumerable <T> documents,
                                    CancellationToken cancellation)
 {
     return(_inner.LoadIntoTempTableAsync(tenant, serializer, conn, documents.OfType <TRoot>(), cancellation));
 }