title: LINQ dynamic from clause
body: <p>I use dynamic LINQ for creating queries in runtime. Here is an example: </p>
  
  <pre><code>var result = dbContext.Table1
  .Where(x =&gt; x.Field1 == "SomeValue")
  .Select(x =&gt; new { x.Field1, x.Field2 });
  </code></pre>
  
  <p>Here I can dynamically change where clause and select clause, but is there any way for dynamic from clause? </p>
  
  <p>If I want to change dbContext.Table1 with some other table in runtime? Or I must use SQL for that?</p>
  
  <p>EDIT: About duplicate question suggestion: It is the same question, but there isn't right answer in that question. The answer provided there is not generic enough, I would have to put a case statement for each new table...</p>