title: How to "let" in lambda expression?
body: <p>How can I rewrite this linq query to Entity on with lambda expression?<br>
  I want to use <em>let</em> keyword or an equivalent in my lambda expression.</p>
  
  <pre><code>var results = from store in Stores
                let AveragePrice =  store.Sales.Average(s =&gt; s.Price)
                where AveragePrice &lt; 500 &amp;&amp; AveragePrice &gt; 250
  </code></pre>
  
  <p>For some similar questions like what is commented under my question, it's suggested to </p>
  
  <pre><code>.Select(store=&gt; new { AveragePrice = store.Sales.Average(s =&gt; s.Price), store})
  </code></pre>
  
  <p>which will calculate AveragePrice  for each item, while in Query style I mentioned, <em>let</em> expression prevents to calculate average many times.</p>