title: Instantiate empty IQueryable for use with Linq to sql
body: <p>I need to be able to either have an optional parameter in a Linq query, or be able to assign the query to a var in something like an IF if that optional parameter needs to be removed from the query.</p>
  <p>If I set the query var inside the IF statement then it tells me that the var doesn't exist in context when I try to loop through it.</p>
  <pre class="lang-csharp prettyprint-override"><code>if (whichGroup == &quot;All&quot;)
  {
      var listOppLineData = (from o in db.opportunity_vws
                             where o.fiscal_yr_and_qtr == qtr
                             select o
                            );
  }
  else
  {
      var listOppLineData = (from o in db.opportunity_vws
                             where o.fiscal_yr_and_qtr == qtr &amp;&amp; o.Group == whichGroup
                             select o
                            );
  }
              
  foreach (var data in listOppLineData)  //listOppLineData doesn't exist here
  {
   ...
  </code></pre>
  <p>I need to set the var before the IF statement I think, but I don't know what to set it to.</p>
  <pre><code>var listOppLineData = &quot;&quot;; // gives me 
  Cannot implicitly convert type 'System.Linq.IQueryable&lt;Forecast.Models.opportunity_vw&gt;' to 'string'
  
  IQueryable listOppLineData = new IQueryable(); //gives me
          Cannot create an instance of the abstract class or interface 'System.Linq.IQueryable'
  </code></pre>