I wrote the following inside my asp.net mvc application:
double d = visits.Average(d=> d.amount);
But the above code ingores any object that is Null, returning an unrealistic result in my case. How can I force the Average function to calculate the average as :
double d = visits.Sum(d=> d.amount)/visit.Count();
So you want
nullvalues to be interpreted as 0?