title: Initialization of var in C#
body: <p>Consider below code:</p>
  
  <pre><code>public IEnumerable &lt;Country&gt; ListPopulation()
  {
      foreach(var continent in Continents)
      {
          var ids = context.continentTable
                     .where(y=&gt;y.Name == continent.name)
                     .select(x=&gt;x.countryId);
  
      }
  
      return GetPopulation(ids);// ids is not available here
  }
  
  Public IEnumerable&lt;Country&gt;GetPopulation(IQueryable&lt;int&gt; idnumbers)
  {
  
  }
  </code></pre>
  
  <p>How can I initialize the <strong><code>var ids</code></strong> such that I can use it to call <code>GetPopulation()</code>?</p>