![]() | ITransactionScope Interface |
Namespace: EBP.Api.Interfaces.Database
The ITransactionScope type exposes the following members.
Name | Description | |
---|---|---|
![]() | Database |
Sets the database.
|
![]() | RootScope |
Returns true if this transaction is in the root scope, otherwise false.
|
![]() | ScopeLevel |
Scope level
|
Name | Description | |
---|---|---|
![]() | Complete |
Commits the database transaction
|
![]() | Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.) |
ITransactionScope instance = Utils<ExtensionType>.GetInterface<ITransactionScope>();
using(ITransactionScope ts = Utils<ExentensionType>.GetInterface<ITransactionScope>()) { // Set transaction database ts.Database = MyExtension.Instance.Database; // Execute update or insert queries... if (ts.Complete()) { // Resume treatement infos } else { // Show transaction error standard message Utils<MyExtension>.ShowErrors(MyExtension.HostOwnerForm, ErrorKind.Error, "Echec de transaction"); } }