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); } }
public Task LoadIntoTempTableAsync(ITenant tenant, ISerializer serializer, NpgsqlConnection conn, IEnumerable <T> documents, CancellationToken cancellation) { return(_inner.LoadIntoTempTableAsync(tenant, serializer, conn, documents.OfType <TRoot>(), cancellation)); }