public async Task <OperationResult> UpdateAsync(StaffTitle staffTitle)
        {
            try
            {
                await _dao.UpdateAsync(staffTitle);

                return(new OperationResult()
                {
                    Success = true
                });
            }
            catch (Exception e)
            {
                return(new OperationResult()
                {
                    Success = true, Exception = e
                });
            }
        }
Example #2
0
        public async virtual Task <OperationResult> UpdateAsync(StaffTitle staffTitle)
        {
            try
            {
                using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled);
                await _dao.UpdateAsync(staffTitle);

                transactionScope.Complete();
                return(new OperationResult <List <StaffTitle> > {
                    Success = true
                });
            }
            catch (Exception e)
            {
                return(new OperationResult <List <StaffTitle> >()
                {
                    Success = false, Exception = e
                });
            }
        }