title: Passing object of anonymous type as parameter to a method
body: <p>I need do something like this:</p>
  
  <pre><code>public class carros 
  {
      public int id { get; set; }
      public string nome { get; set; }
  }
  
  public void listar_carros()
  {
      List&lt;carros&gt; cars = new List&lt;carros&gt;();
      cars.Add(new carros{ id= 1, nome = "Fusca" });
      cars.Add(new carros{ id= 2, nome = "Gol" });
      cars.Add(new carros{ id= 3, nome = "Fiesta" });
  
      var queryResult = from q in cars 
                        where q.nome.ToLower().Contains("eco") 
                        orderby q.nome 
                        select new { q.nome, q.id };
  
      doSomething(queryResult)
  }
  </code></pre>
  
  <p>I need to pass the <code>queryResult</code> variable to function <code>doSomething()</code>. I tried use a dynamic type, <code>List&lt;T&gt;</code> object, but nothing works</p>
  
  <pre><code>public void doSomething(???? queryResult)
  {
      foreach (carros ca in queryResult)
      {
          Response.Write(ca.nome);
          Response.Write(" - ");
          Response.Write(ca.id);
      }
  }
  </code></pre>