Skip to content

InsertListAsync Method ​

Definition ​

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Overloads ​

NameDescription
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 ​

NameDescription
cancellationTokenCancellation token.
commandTimeoutCommand timeout in seconds. Use -1 for provider default.
commitIntervalBatch size for transactional commits or flushes.
entityTypeThe concrete mapped POCO type for the rows in list.
listItems to insert. Each non-null item must be assignable to entityType.
useTransactionto 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 ​

NameDescription
TThe entity (row) type.

Parameters ​

NameDescription
cancellationTokenCancellation token.
commandTimeoutCommand timeout in seconds. Use -1 for provider default.
commitIntervalBatch size for transactional commits or flushes.
listItems to insert.
useTransactionto 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.