I’ve a collection with the data like this.
--------------------------------------------
| key | customer Name | code | isActive |
--------------------------------------------
| 30002 | XYZ | 234 | 1 |
--------------------------------------------
| 30002 | XYZ | 234 | 1 |
--------------------------------------------
| 30002 | XYZ | 234 | 1 |
--------------------------------------------
| 30034 | ERR | 344 | 1 |
--------------------------------------------
| 30031 | LDD | 343 | 1 |
--------------------------------------------
how can select the distinct data using linq?
You can create your own comparier like this:
Then use:
I think that code can be optimized, but the overall idea is presented 🙂