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); } }); }
public void UpdateContent(Content content) { Content currentContent = GetContentByID(content.ProductID, content.ConnectorID); List <string> listOfIngnoreProperties = generateUpdateProperties.GenerateIgnoreProperties( new Content(), x => x.CreatedBy, x => x.LastModifiedBy, x => x.LastModificationTime, x => x.CreationTime); List <string> listOfChanges = generateUpdateProperties.GetPropertiesForUpdate(content, currentContent, listOfIngnoreProperties); if (listOfChanges.Count > 0) { var updateQuery = string.Join(",", listOfChanges); petaPoco.Update <Content>(string.Format(@" SET {2} WHERE ProductID = {0} AND ConnectorID = {1} ", content.ProductID, content.ConnectorID, updateQuery)); } }