title: How do I dynamically add properties to object using LINQ
body: <p>I have a <code>Queryable&lt;Foo&gt;</code> and a <code>List&lt;Bar&gt;</code>. I'm already able to map which books are related to which Authors using LINQ.</p>
  
  <p>I would like to use values of the <code>Bar</code> and dynamically add properties to the <code>Foo</code> object as shown below, obviously changing the type to <code>object</code> or <code>dynamic</code>.</p>
  
  <p>Is this possible with LINQ, and if so, how can I do it?</p>
  
  <p><strong>Sample Desired Result (eventually parsed to JSON)</strong></p>
  
  <pre><code>{
      "Id" : 1,
      "Name" : "John Doe",
      "Garden" : 7,
      "Pilot" : 4
  }
  </code></pre>
  
  <p><strong>Sample Classes</strong></p>
  
  <pre><code>public class Foo
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  
  public class Bar
  {
      public string Title { get; set; }
      public int Count { get; set; }
  }
  </code></pre>