重複を削除:C#リストプール/私はこのようになりますリストを持っている
Id: 1
Line1: Microsoft
Line2: Windows
Line3: Server
Line4: null
Line5: null
Id: 2
Line1: Microsoft
Line2: Windows
Line3: Server
Line4: null
Line5: null
Id: 3
Line1: Microsoft
Line2: Windows
Line3: Server
Line4: Development
Line5: null
今私は/プールすべての重複削除したいと思います(同上1および2)。 これはどのように可能ですか?
私はこのような何か試してみました:
result = result.DistinctBy(x => x.Line3).ToList();
をしかし、それも正しくない同上3を削除します。
期待出力:
Id: 2 // can also be 1, doesn't matter
Line1: Microsoft
Line2: Windows
Line3: Server
Line4: null
Line5: null
Id: 3
Line1: Microsoft
Line2: Windows
Line3: Server
Line4: Development
Line5: null
「すべての複製をプールする」とはどういう意味ですか?期待される出力を表示します。 – MrZander
申し訳ありませんが、削除したいと思います。私の編集@MrZanderを見てください – Anokrize
重複している場合は、1または2を維持するかどうかは重要ですか? – msitt