LINQ結果内の要素を比較する方法を見つけようとしています
これはLINQコードです
var sets =
from a in patient.AsParallel()
from b in patient.AsParallel()
from c in patient.AsParallel()
from d in patient.AsParallel()
where a.VisitNum < b.VisitNum && b.VisitNum < c.VisitNum && c.VisitNum < d.VisitNum
select new { a, b, c, d };
var sets1 =
from a in patient1.AsParallel()
from b in patient1.AsParallel()
from c in patient1.AsParallel()
from d in patient1.AsParallel()
select new { a, b, c, d };
このコードを使用して比較しましたが、毎回falseになります
if (Enumerable.SequenceEqual(sets, sets1) == true)
なにか提案を ?
// ジャニの回答として更新
public class Result
{
public ACVsize5 a { get; set; }
public ACVsize5 b { get; set; }
public ACVsize5 c { get; set; }
public ACVsize5 d { get; set; }
}
public override Boolean Equals(Result other)
{
return other.a.date.ToString() == a.date.ToString() && other.a.RaId.ToString() == a.RaId.ToString() && other.b.date.ToString() == b.date.ToString() && other.b.RaId.ToString() == b.RaId.ToString() && other.c.date.ToString() == c.date.ToString() && other.c.RaId.ToString() == c.RaId.ToString() && other.d.date.ToString() == d.date.ToString() && other.d.RaId.ToString() == d.RaId.ToString();
}
var sets =
from a in patient
from b in patient
from c in patient
from d in patient
where a.VisitNum < b.VisitNum && b.VisitNum < c.VisitNum && c.VisitNum < d.VisitNum
select new Result { a = a, b = b, c = c, d = d };
var sets1 =
from t in patient1
from y in patient1
from u in patient1
from p in patient1
where t.VisitNum < y.VisitNum && y.VisitNum < u.VisitNum && u.VisitNum < p.VisitNum
select new Result { a = t, b = y, c = u, d = p };
しかし、オーバーライドメソッドでエラーが発生しました
//Error 1 no suitable method found to override