title: Storing query result into a variable
body: <p>I'm a very beginner of C# and have some troubles with correct understading of generic types. In this example I would like to somehow store a query result into a variable.</p>
  
  <p>The code I showed below is incorrect, because generic type T should specified.</p>
  
  <pre class="lang-cs prettyprint-override"><code>    public class Data
      {
          public IQueryable&lt;T&gt; Results { get; set; }
  
          public Data()
          {
              var db = new Database();
          }
          public void Store()
          {
              Results = db.Products.Select(x =&gt; new { x.ProductName, x.Cost });
          }
      }
  </code></pre>
  
  <p>Is it possible to do it without declaring a special class for only one use, like this one?</p>
  
  <pre><code>public class ProductView 
  {
     public string ProductName { get; set; }
     public int Country { get; set; }
  }
  ...
  public IQueryable&lt;ProductView &gt; Results { get; set; }
  </code></pre>
  
  <p>Also, why dynamic type doesn't suit in this example?</p>
  
  <pre><code>public dynamic Results { get; set; }
  </code></pre>