title: Can I pass an anonymous type as a parameter to a function?
body: <p>After reading <a href="https://stackoverflow.com/questions/3199093/why-cant-i-pass-an-anonymous-type-as-a-parameter-to-a-function">this post</a> i realized that i cannot pass an anonymous type as a parameter to a function. So what other options do i have?</p>
  
  <p>Perhaps, passing a <code>Query.ToList</code> as parameter would help, or am i re-inventing the wheel?</p>
  
  <p><strong>Update:</strong> I have the following query, which i would like to pass to a function:</p>
  
  <pre><code>Sub Test
      Dim Query = (From c In DB Select New With { .ElementName = c.Name })
      DoSomething(Query)
  End sub
  
  Private Function DoSomething(ByVal Q as object) as string
      Dim Query = From c In Q Select c
  End Function
  </code></pre>
  
  <p>And the error i get is </p>
  
  <blockquote>
    <p>Expression of type 'Object' is not queryable</p>
  </blockquote>