private void UpdateCurrentMasterGroupMappings() { List <MasterGroupMapping> listOfMasterGroupMappings = masterGroupMappingRepo.GetListOfAllMasterGroupMappings(); listOfMasterGroupMappings .Where(x => x.ConnectorID == null) .Where(x => x.ProductGroupID != -1) .ForEach(masterGroupMapping => { masterGroupMapping.ProductGroupID = -1; masterGroupMappingRepo.UpdateMasterGroupMapping(masterGroupMapping); }); }
private void UpdateProductGroupMappingInDestConnector(List <MasterGroupMapping> listOfProductGroupMappingToUpdate, List <MasterGroupMapping> listOfParentProductGroupMapping) { List <string> ignoreList = generateIgnoreList.GenerateIgnoreProperties(new MasterGroupMapping(), x => x.MasterGroupMappingID, x => x.ConnectorID, x => x.ParentMasterGroupMappingID, x => x.SourceProductGroupMappingID); listOfProductGroupMappingToUpdate.ForEach(productGroupMapping => { MasterGroupMapping compareProductGroupMapping = listOfParentProductGroupMapping.SingleOrDefault(x => x.MasterGroupMappingID == productGroupMapping.SourceProductGroupMappingID); if (compareProductGroupMapping != null) { masterGroupMappingRepo.UpdateMasterGroupMapping(productGroupMapping, compareProductGroupMapping, ignoreList); } }); }