public void DeleteDefectXrefCommodity(Xref_Defects_Commodity reference)
 {
     DispositionDataContext dispositionDb = new DispositionDataContext();
     var result = (from d in dispositionDb.Xref_Defects_Commodities
                   where d.CommodityID == reference.CommodityID && d.DefectID == reference.DefectID 
                   select d).Single();
     dispositionDb.Xref_Defects_Commodities.DeleteOnSubmit(result);
     dispositionDb.SubmitChanges();
     DispositionCacheManager.RefreshDefect2Commodities();
 }
        public void CreateDefectXrefCommodity(Xref_Defects_Commodity reference)
        {
            DispositionDataContext dispositionDb = new DispositionDataContext();
            dispositionDb.Xref_Defects_Commodities.InsertOnSubmit(reference);
            try
            {
                dispositionDb.SubmitChanges();
                DispositionCacheManager.RefreshDefect2Commodities();
            }
            catch (Exception ex)
            {

            }
        }
 partial void DeleteXref_Defects_Commodity(Xref_Defects_Commodity instance);
 partial void UpdateXref_Defects_Commodity(Xref_Defects_Commodity instance);
 partial void InsertXref_Defects_Commodity(Xref_Defects_Commodity instance);
		private void detach_Xref_Defects_Commodities(Xref_Defects_Commodity entity)
		{
			this.SendPropertyChanging();
			entity.Defect = null;
		}