This is the exact translation. I have no idea why you need the OrderBy
tho, considering you are not using the elements in the Select
var methods = typeof(double).GetMethods()
.OrderBy(x=>x.Name)
.GroupBy(x=>x.Name)
.Select(x=> new { MethodName = x.Key, NumberOfOverloads = x.Count()});
The same result is obtained by
var methods = typeof(double).GetMethods()
.GroupBy(x=>x.Name)
.Select(x=> new { MethodName = x.Key, NumberOfOverloads = x.Count()});
and you save some computational time since you don't have to order the collection.