UnitOfWork2.CommitAsync Method (IDataAccessAdapter, Boolean, CancellationToken) |
Async variant of
Commit(IDataAccessAdapter, Boolean).
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes.
Namespace: SD.LLBLGen.Pro.ORMSupportClassesAssembly: SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.0.0.0 (5.0.0)
Syntax public virtual Task<int> CommitAsync(
IDataAccessAdapter adapterToUse,
bool autoCommit,
CancellationToken cancellationToken
)
Public Overridable Function CommitAsync (
adapterToUse As IDataAccessAdapter,
autoCommit As Boolean,
cancellationToken As CancellationToken
) As Task(Of Integer)
Parameters
- adapterToUse
- Type: SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter
Adapter to use. It will start a new transaction if no transaction is in progress. - autoCommit
- Type: System.Boolean
if true, it will commit/rollback the transaction passed in using the following rules:
- if no exception is thrown: commit
- if an exception is thrown: rollback - cancellationToken
- Type: System.Threading.CancellationToken
The cancellation token.
Return Value
Type:
Task<Int32>
The total # of entities affected by all actions performed in the Commit method
Exceptions See Also