I am trying to grab common values between two HashSets
of the same type with identical lists, yet I get 0 values returned after the IntersectWith
command. I am using the same list to begin with as a troubleshooting test, but eventually the value of returnlist
will change as int y iterates through the sequence.
Debugging shows that comparelist.IntersectWith(returnlist);
changes comparelist
to 0 items. Just to clarify, returnlist
and comparelist
contain the same items in the same order.
CfgPersonQuery firstquery = new CfgPersonQuery();
firstquery.Filter.Add("skill_dbid", skills.First());
comparelist = new HashSet<CfgPerson>(confService.RetrieveMultipleObjects<CfgPerson>(firstquery));
foreach (int y in skills.Skip(1))
{
try
{
CfgPersonQuery query = new CfgPersonQuery();
query.Filter.Add("skill_dbid", skills.First());
HashSet<CfgPerson> returnlist = new HashSet<CfgPerson>(
confService.RetrieveMultipleObjects<CfgPerson>(query));
comparelist.IntersectWith(returnlist);
}
catch
{
return null;
}
}