Appearance
InsertListAsync Method
Definition
- Namespace:
JASE.Database - Assembly:
JASE.Database.dll
Overloads
| Name | Description |
|---|---|
Task<int> InsertListAsync(IEnumerable<T> list, int commitInterval = null, bool useTransaction = null, int commandTimeout = null, CancellationToken cancellationToken = null) | Inserts a list of records into the corresponding table. |
Task<int> InsertListAsync(Type entityType, IEnumerable list, int commitInterval = null, bool useTransaction = null, int commandTimeout = null, CancellationToken cancellationToken = null) | Inserts a list of records into the corresponding table using a runtime entity type. |
Task<int> InsertListAsync(Type entityType, IEnumerable list, int commitInterval = null, bool useTransaction = null, int commandTimeout = null, CancellationToken cancellationToken = null)
csharp
Task<int> InsertListAsync(Type entityType, IEnumerable list, int commitInterval = null, bool useTransaction = null, int commandTimeout = null, CancellationToken cancellationToken = null)Inserts a list of records into the corresponding table using a runtime entity type.
Parameters
| Name | Description |
|---|---|
cancellationToken | Cancellation token. |
commandTimeout | Command timeout in seconds. Use -1 for provider default. |
commitInterval | Batch size for transactional commits or flushes. |
entityType | The concrete mapped POCO type for the rows in list. |
list | Items to insert. Each non-null item must be assignable to entityType. |
useTransaction | to wrap the bulk insert operation in a database transaction managed by this method. When an ambient transaction is already active, a savepoint is used instead. to execute without creating or managing a transaction. |
Returns
The number of rows inserted.
Task<int> InsertListAsync(IEnumerable<T> list, int commitInterval = null, bool useTransaction = null, int commandTimeout = null, CancellationToken cancellationToken = null)
csharp
Task<int> InsertListAsync(IEnumerable<T> list, int commitInterval = null, bool useTransaction = null, int commandTimeout = null, CancellationToken cancellationToken = null)Inserts a list of records into the corresponding table.
Type parameters
| Name | Description |
|---|---|
T | The entity (row) type. |
Parameters
| Name | Description |
|---|---|
cancellationToken | Cancellation token. |
commandTimeout | Command timeout in seconds. Use -1 for provider default. |
commitInterval | Batch size for transactional commits or flushes. |
list | Items to insert. |
useTransaction | to wrap the bulk insert operation in a database transaction managed by this method. When an ambient transaction is already active, a savepoint is used instead. to execute without creating or managing a transaction. |
Returns
The number of rows inserted.