public async Task ExecuteOperation(IOperationCommand operation) { using (var transaction = _accountRepository.BeginTransaction()) { try { await operation.Execute(_accountRepository); transaction.Commit(); } catch (Exception ex) { transaction.Rollback(); throw ex; } } }
public double Invoke(IOperationCommand mathOperator) { return(mathOperator.Execute()); }