How can I declare a variable outside of a block when the variable defines an anonymous class in C#
<p>I have the following code and it works good:</p>

<pre><code>var _data = (from qu in _que.GetAll(
  u =&gt; u.company == "GE" )
  select new {
    qu.name,
    qu.address
});
</code></pre>

<p>The signature of the GetALL method is </p>

<pre><code>ICollection&lt;T&gt; GetAll(Expression&lt;Func&lt;T, bool&gt;&gt; predicate);
</code></pre>

<p>Now I need to enclose the above in some block so it becomes:</p>

<pre><code>{
    var _data = (from qu in _que.GetAll(
      u =&gt; u.company == "GE" )
      select new {
        qu.name,
        qu.address
    });
}
var _abc = _data; &lt;&lt;&lt; doesn't work now
</code></pre>

<p>Once I do this then _data becomes local and I can't access it from outside the block. I assume that what I need to do is to declare _data outside of the block. But what do I declare it too as they type that's returned and placed into _data is an anonymous type. Is there some way I can declare _data without having to change the query or make up some return type?</p>
