public async Task <ApiResult> Handle(DeleteAutomation request, CancellationToken cancellationToken) { using (var scope = _unitOfWorkFactory.Create()) { var result = await _automationService.Delete(request, cancellationToken); if (result.Success) { scope.Commit(); } return(result); } }