|Not quite. An anonymous type uses value equality, not reference equality:
Because the Equals and GetHashCode methods on anonymous types are defined in terms of the Equals and GetHashCode methods of the properties, two instances of the same anonymous type are equal only if all their properties are equal.
DistinctBy operator which was added in .NET 6 uses a different approach from the blog you linked to:
runtime/Distinct.cs at ebba1d4acb7abea5ba15e1f7f69d1d1311465d16 · dotnet/runtime · GitHub[^]
And the answer will also depend on whether the
DistinctBy method gets translated to SQL, or evaluated on the client.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."