C# – Select distinct objects based on a property

There are three ways to select distinct objects based on a property using Linq: These select one movie per year: GroupBy() is the simplest because it doesn’t require any additional code. Distinct() is faster but it’s more complicated. DistinctBy() is the fastest and simplest, but requires the most code (it requires .NET 6 or getting … Read more