OperationServiceExtensionsExecuteContinuousOperation Method (IOperationService, ActionIOperationService) |
Executes the callback function as one continuous operation by providing temporary instance of
IOperationService,
which holds internal locks taken on lockable entities (such as order) until the operation ends.
It's strongly recommended to avoid potentially obstructive calls in the callback, i.e network calls, heavy I/O or CPU-bound calls, thread blocking and so on, because touched entities will remain locked for a long time.
Namespace:
Resto.Front.Api.Extensions
Assembly:
Resto.Front.Api.V6 (in Resto.Front.Api.V6.dll)
Syntax Remarks
It could be useful for calling several methods of the local
IOperationService instance sequentially
when it's important to call them one by one without outside changes.
While all committed changes will immediately become visible for everyone,
no one except of the provided callback will be allowed to alter entities which were touched via that short-living
IOperationService (input argument of the callback). For example, you can create a new order and add there guests, products and external prepay using one edit session, but you cannot print order items or process external prepay in the same session, because these operations can't be rolled back and thus aren't available via
IEditSession. Executing these operations separately on a global
Operations isn't reliable because there is a chance to be interrupted by a user, other plugin or background entity change handlers, which may prevent further our edits by applying conflicting changes or by locking an entity for a long time.
See Also