LINQ GroupBy Anonymous Type
问题 I am wondering why GroupBy works with anonymous types. List<string> values = new List<string>(); values.GroupBy(s => new { Length = s.Length, Value = s }) Anonymous types do not implement any interfaces, so I am confused how this is working. I assume that the algorithm is working by creating an instance of the anonymous type for each item in the source and using hashing to group the items together. However, no IEqualityComparer is provided to define how to generate a hash or whether two