title: LINQ - Group Join + Where clause
body: <p>I have two lists</p>
  
  <pre><code>var stores = new[] 
  {
      new { Code = 1, Name = "Store 1" },
      new { Code = 2, Name = "Store 2" }    
  };
  
  var orders = new[] 
  {
      new { Code = 1, StoreCode = 1, TotalValue = 4.12 },
      new { Code = 2, StoreCode = 1, TotalValue = 14.12 },
      new { Code = 3, StoreCode = 1, TotalValue = 24.12 }
  };
  </code></pre>
  
  <p>OUTPUT desired</p>
  
  <p>StoreName = Store 1 | TotalValue = 38.24</p>
  
  <p><s>LINQ to SQL</s> LINQ to Objects</p>
  
  <pre><code>var result = (from s in stores
                join o in orders on s.Code equals o.StoreCode into grp
                where o.TotalValue &gt; 10 // error
                select new
                {
                    StoreName = s.Name,
                    TotalValue = grp.Sum(x =&gt; x.TotalValue)
                }).ToList();
  </code></pre>
  
  <p>Error: The name 'o' does not exist in the current context.</p>
  
  <p>In this scenario, how to filter by order?</p>