public async Task <OperationResult> CreateAsync(StaffTitle item)
        {
            try
            {
                await _dao.CreateAsync(item);

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

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