score:2

Accepted answer

It is working if you force the cast of the dynamic to double instead of letting the .ToDouble method find the appropriate type itself. Instead, do an explicit cast:

for(var i = 0; i < result.Count; i++)
    cumulativeAvg.Add(result.Take(i + 1).Average(r => (double)r.myDouble));

Related Articles