Пример #1
0
        public async Task <bool> AddCustomer(Customer customer)
        {
            bool success = false;

            using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
            {
                try
                {
                    success = await _customerDAL.AddCustomer(customer);

                    scope.Complete();
                }
                catch (Exception)
                {
                    success = false;
                    throw;
                }
            }
            return(success);
        }