<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />

System.Data.SqlClient.SqlBulkCopy

public sealed class SqlBulkCopy : IDisposable
Lets you efficiently bulk load a SQL Server table with data from another source.
namespace System.Data.SqlClient { public sealed class SqlBulkCopy : IDisposable { public int BatchSize { get; set; } public int BulkCopyTimeout { get; set; } public SqlBulkCopyColumnMappingCollection ColumnMappings { get; } public string DestinationTableName { get; set; } public bool EnableStreaming { get; set; } public int NotifyAfter { get; set; } public event SqlRowsCopiedEventHandler SqlRowsCopied; public SqlBulkCopy(SqlConnection connection); public SqlBulkCopy(SqlConnection connection, SqlBulkCopyOptions copyOptions, SqlTransaction externalTransaction); public SqlBulkCopy(string connectionString); public SqlBulkCopy(string connectionString, SqlBulkCopyOptions copyOptions); public void Close(); public void WriteToServer(DbDataReader reader); public void WriteToServer(DataRow[] rows); public void WriteToServer(DataTable table); public void WriteToServer(DataTable table, DataRowState rowState); public void WriteToServer(IDataReader reader); public Task WriteToServerAsync(DbDataReader reader); public Task WriteToServerAsync(DbDataReader reader, CancellationToken cancellationToken); public Task WriteToServerAsync(DataRow[] rows); public Task WriteToServerAsync(DataRow[] rows, CancellationToken cancellationToken); public Task WriteToServerAsync(DataTable table); public Task WriteToServerAsync(DataTable table, DataRowState rowState); public Task WriteToServerAsync(DataTable table, DataRowState rowState, CancellationToken cancellationToken); public Task WriteToServerAsync(DataTable table, CancellationToken cancellationToken); public Task WriteToServerAsync(IDataReader reader); public Task WriteToServerAsync(IDataReader reader, CancellationToken cancellationToken); } }