anonymous types and generics
<p>I cannot find a way to pass an anonymous type to a generic class as a type parameter.</p>

<p>// this is the class I want to instantiate</p>

<pre><code>public class ExtArrayStore&lt;T&gt; : IViewComponent 
{
    public IQueryable&lt;T&gt; Data { get; set; }
</code></pre>

<p>...
// the creator class</p>

<pre><code>public static class ArrayStoreGenerator
{
    public static ExtArrayStore&lt;T&gt; CreateInstance&lt;T&gt;(IQueryable&lt;T&gt; query)
    {
        return new ExtArrayStore&lt;T&gt;();
    }
}
</code></pre>

<p>// trying to use this</p>

<pre><code>IQueryable usersQuery= ((from k in bo.usersselect new { userid = k.userid, k.username}).AsQueryable());
      var x = ArrayStoreGenerator.CreateInstance(usersQuery);
</code></pre>

<p>I am getting;</p>

<p>The type arguments for method <em>ArrayStoreGenerator.CreateInstance(System.Linq.IQueryable)' cannot be inferred from the usage. Try specifying the type arguments explicitly</em></p>

<p>Is there a way to achieve this? ( I am thinking of Interfaces and returning an interface, but not sure if it would work) can any one help with passing anon types to generics.</p>
