title: Creating a dynamic Linq select clause from Expressions
body: <p>Let's say I have defined the following variables:</p>
  
  <pre><code>IQueryable&lt;MyClass&gt; myQueryable;
  Dictionary&lt;string, Expression&lt;Func&lt;MyClass, bool&gt;&gt;&gt; extraFields;
  // the dictionary is keyed by a field name
  </code></pre>
  
  <p>Now, I want to tack on some dynamic fields to the IQueryable, so that it returns an <code>IQueryable&lt;ExtendedMyClass&gt;</code>, where <code>ExtendedMyClass</code> is defined as:</p>
  
  <pre><code>class ExtendedMyClass
  {
    public MyClass MyObject {get; set;}
    public IEnumerable&lt;StringAndBool&gt; ExtraFieldValues {get; set;}
  }
  
  class StringAndBool
  {
    public string FieldName {get; set;}
    public bool IsTrue {get; set;}
  }
  </code></pre>
  
  <p>In other words, for every value in <code>extraFields</code>, I want to have a value in <code>ExtendedMyClass.ExtraFieldValues</code> representing whether that expression evaluates to True or not for that row.</p>
  
  <p>I have a feeling this should be doable in dynamic Linq and LinqKit, though I've never used that seriously before.  I'm also open to other suggestions, especially if this can be done in good ol' strong-typed Linq.</p>
  
  <p>I am using Linq to Entities, so the query needs to translate to SQL.</p>