<p>I have a Linq query that I want to call from multiple places:</p>

<pre><code>var myData = from a in db.MyTable
             where a.MyValue == "A"
             select new  {
                            a.Key,
                            a.MyValue
                          };
</code></pre>

<p>How can I create a method, put this code in it, and then call it?</p>

<pre><code>public  ???  GetSomeData()
{
   // my Linq query
}
</code></pre>

```
IQueryable
```
So your method declaration would look like
```
```
public IQueryable GetSomeData()
```
```