When my model has values, i can get the average easily with this code
@Model.Where(a => a.count!= null).Average(a => a.totalday).ToString()
For example:
count = 7 totalday= 3 average= 2.33
But i can't get average value when my model values equals to null or zero. As you know we can't divide 0 to 0 or null to null.
I mean;
count = 0 or null; totalday= 0 or null; average= ????
If all values are null, how can i write my table to "0" or a string like "there is no any average"
I tried lots of things but i get an error.