I have got a list which looks like this:
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
Now I would like to pool / remove all the duplicates (Id 1 and 2). How is this possible?
I tried something like this:
result = result.DistinctBy(x => x.Line3).ToList();
But then it would also remove Id 3 which is not correctly.
Expected output:
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