Complete() публичный Метод

public Complete ( ) : void
Результат void
        private void UpdateInventory(DependentTransaction dt, SalesOrderDetail salesDetail)
        {
            try
            {
                using (AdventureWorksDataContext dc = new AdventureWorksDataContext())

                {
                    using (TransactionScope scope = (dt != null ?new TransactionScope(dt) :new TransactionScope(TransactionScopeOption.Suppress)))
                    {
                        var inventoryRow =
                                    (from pi in dc.ProductInventories
                                    where pi.ProductID == salesDetail.ProductID
                                    && pi.LocationID == 7 //finished goods storage
                                    select pi).SingleOrDefault();
                        if (inventoryRow != null)
                        {
                            inventoryRow.Quantity -= salesDetail.OrderQty;
                            inventoryRow.ModifiedDate = DateTime.Now;
                            Console.WriteLine(
                            "Product {0}: Reduced by {1}",
                            inventoryRow.ProductID, salesDetail.OrderQty);
                            dc.SubmitChanges();
                        }
                        scope.Complete();


                    }
                }
            }
                
            catch (Exception)
            {
                
                throw;
            }
            finally
            {
                //the ambient transaction will block on complete
                if (dt != null)
                {
                    dt.Complete();
                    dt.Dispose();
                }

            }
        }