重複の可能性:
二重 foreach ループの最適化
二重の foreach ループを単一の foreach ループに変えようとしています
foreach (KeyValuePair<Int64, MyObject> kvp in originCounts)
{
foreach (KeyValuePair<Int64, MyObject> testkvp in originCounts)
{
//Run Comparison on testkvp ad kvp to see if all elements of object are the same
}
}
そして MyObject はそのように定義されています
public class MyObject
{
public string FirstName{ get; set; }
public string LastName{ get; set; }
public int UserID { get; set; }
public string Address { get; set; }
}
1つのループを使用してこれを行う方法はありますか? それらがすべて同じ場合は、Int64 のリストに追加します。同じ辞書です。