title: Simple way to return anonymous types (to make MVC using LINQ possible)
body: <p>I'd like to implement MVC while using LINQ (specifically, LINQ-to-entities).  The way I would do this is have the Controller generate (or call something which generates) the result-set using LINQ, then return that to the View to display the data.  The problem is, if I do:</p>
  
  <pre><code>return (from o in myTable select o);
  </code></pre>
  
  <p><strong>All</strong> the columns are read from the database, even the ones (potentially dozens) I don't want.  And - more importantly - I <em>can't</em> do something like this:</p>
  
  <pre><code>return (from o in myTable select new { o.column });
  </code></pre>
  
  <p>because there is no way to make anonymous types type-safe!  I know for sure there is no nice, clean way of doing this in 3.5 (<a href="http://tomasp.net/blog/cannot-return-anonymous-type-from-method.aspx" rel="nofollow noreferrer">this</a> is not clean...), <strong>but what about 4.0?  Is there anything planned, or even proposed?</strong>  Without something like duck-typing-for-LINQ, or type-safe anonymous return values (it seems to me the compiler should certainly be capable of that), it appears to be nearly impossible to cleanly separate the Controller from the View.</p>