title: Average extension method in Linq for default value
body: <p>Anyone know how I can set a default value for an average? I have a line like this...</p>
  
  <pre><code>dbPlugins = (from p in dbPlugins
                  select new { Plugin = p, AvgScore = p.DbVersions.Average(x =&gt; x.DbRatings.Average(y =&gt; y.Score)) })
              .OrderByDescending(x =&gt; x.AvgScore)
              .Select(x =&gt; x.Plugin).ToList();
  </code></pre>
  
  <p>which throws an error becase I have no ratings yet. If I have none I want the average to default to 0. I was thinking this should be an extension method where I could specify what the default value should be.</p>