SyntaxFix
Write A Post
Hire A Developer
Questions
Use MoreLINQ, which has a DistinctBy method :)
DistinctBy
IEnumerable<Car> distinctCars = cars.DistinctBy(car => car.CarCode);
(This is only for LINQ to Objects, mind you.)