title: LINQ Select from dynamic tableName string
body: <p>I want to get list of records from an entity model (I'm using EF version 5) with a particular accountID. I'm being supplied with the tableName string (this has to be dynamic) and the accountID. I'm trying the following 2 methods but none of them is working (giving me errors on the IQueryable object 'table': </p>
  
  <hr>
  
  <pre><code>PropertyInfo info = _db.GetType().GetProperty(tableName);
  IQueryable table = info.GetValue(_db, null) as IQueryable;
  
  var query = table.Where(t =&gt; t.AccountID == accID)
                          .Select(t =&gt; t);
  
  List &lt;object&gt; recList = (   from records in table
                              where records.AccountID == accID
                              select records).ToList&lt;object&gt;();
  </code></pre>
  
  <hr>