Exemple #1
0
        public async Task <OperationResult> UpdateAsync(DietaryRestriction item)
        {
            try
            {
                await _dao.UpdateAsync(item);

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

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