Interface IBulkInsert
Interface for fast data inserting into database.
Namespace: Kros.Data.BulkActions
Assembly: Kros.Utils.dll
Syntax
public interface IBulkInsert : IDisposable
Properties
BatchSize
Row count for batch sent to database. If 0, batch size is not limited.
Declaration
int BatchSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
BulkInsertTimeout
Timeout for operation in seconds. If 0, duration of operation is not limited.
Declaration
int BulkInsertTimeout { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
ColumnMappings
Returns a collection of BulkInsertColumnMapping items. Column mappings define the relationships between columns in the data source and columns in the destination. Mappings also specifies which columns are inserted into database. When mapping is set, only columns in mapping collection are inserted. If no mapping is set, all columns from data source are inserted.
Declaration
BulkInsertColumnMappingCollection ColumnMappings { get; }
Property Value
| Type | Description |
|---|---|
| BulkInsertColumnMappingCollection |
DestinationTableName
Destination table name in database.
Declaration
string DestinationTableName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
Insert(IBulkActionDataReader)
Inserts all data from reader.
Declaration
void Insert(IBulkActionDataReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| IBulkActionDataReader | reader | Data source. |
Insert(DataTable)
Inserts all rows from table table.
Declaration
void Insert(DataTable table)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Data.DataTable | table | Source table. |
Insert(IDataReader)
Inserts all data from reader.
Declaration
void Insert(IDataReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Data.IDataReader | reader | Data source. |
InsertAsync(IBulkActionDataReader)
Asynchronously inserts all data from reader.
Declaration
Task InsertAsync(IBulkActionDataReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| IBulkActionDataReader | reader | Data source. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous Insert operation. |
InsertAsync(DataTable)
Asynchronously inserts all rows from table table.
Declaration
Task InsertAsync(DataTable table)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Data.DataTable | table | Source table. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous Insert operation. |
InsertAsync(IDataReader)
Asynchronously inserts all data from reader.
Declaration
Task InsertAsync(IDataReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Data.IDataReader | reader | Data source. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous Insert operation. |