Method InsertAsync
| Improve this Doc View SourceInsertAsync<TSource, TTarget>(DataSet<TSource>, DbTable<TTarget>, Action<ColumnMapper, TSource, TTarget>, Boolean, CancellationToken)
Executes query to insert DataSet data into table.
Declaration
protected abstract Task<int> InsertAsync<TSource, TTarget>(DataSet<TSource> sourceData, DbTable<TTarget> targetTable, Action<ColumnMapper, TSource, TTarget> columnMapper, bool updateIdentity, CancellationToken cancellationToken)
where TSource : class, IEntity, new()
where TTarget : class, IEntity, new()
Parameters
| Type | Name | Description |
|---|---|---|
| DataSet<TSource> | sourceData | The source DataSet. |
| DbTable<TTarget> | targetTable | The target database table. |
| System.Action<ColumnMapper, TSource, TTarget> | columnMapper | Provides column mappings between source DataSet and target database table. |
| System.Boolean | updateIdentity | Specifies whether newly generated identity values should be updated back to the DataSet. |
| System.Threading.CancellationToken | cancellationToken | The async cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Int32> | Number of rows inserted. |
Type Parameters
| Name | Description |
|---|---|
| TSource | Entity type of source DataSet. |
| TTarget | Entity type of target table. |