Exemplo n.º 1
0
        public async Task <OperationResult> DeleteAsync(Serving serving)
        {
            try
            {
                await _dao.DeleteAsync(serving);

                return(new OperationResult()
                {
                    Success = true
                });
            }
            catch (Exception e)
            {
                return(new OperationResult()
                {
                    Success = true, Exception = e
                });
            }
        }
        public async Task <OperationResult> DeleteAsync(Guid id)
        {
            try
            {
                await _dao.DeleteAsync(id);

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

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