title: Combine two anonymous types
body: <p>I asked the related question before and get gretat ansfer on that <a href="https://stackoverflow.com/questions/7370984/how-could-i-define-anonymous-type">How could i define anonymous type?</a></p>
  
  <p>But now i am wondering is it possible to combine two anonymous types</p>
  
  <p>Basically i am storing some weekly data in cache like i described in related queston</p>
  
  <p>So in case i have <code>anonymous type</code> stored as <code>object</code> it is contain some data for current week
  and i want to append today's data to that object everyday.</p>
  
  <p>So i have data in <code>anonymous type</code> as <code>object</code> from one side and from another i have completely the same structured  <code>anonymous type</code> and i want do append/add data from my new <code>anonymous type</code> to the old one which is <code>anonymous type</code> as <code>object</code> and put it back to cache.</p>
  
  <p>If you would look my related question my anonymous type looking like that:</p>
  
  <pre><code>var jsonData = new { total = 0, page = 0, records = 0,
                       rows = new[] { new { dummy = "" } };
  </code></pre>
  
  <p>So the question is how could i combine anonymous types in my case?</p>
  
  <p>For example if it would be two collections i would go like that</p>
  
  <pre><code>List&lt;Data&gt; weeklyFromCahce = GetFromCache()
  List&lt;Data&gt; todaysToCahce = GetFromDataBase();
  </code></pre>
  
  <p>and than i would loop though <code>todaysToCahce</code> and add each item to <code>weeklyFromCahce</code> and that put updated <code>weeklyFromCahce</code> back to cache. </p>
  
  <p>So i want to do similar process but with anonymous types in my case. The combined result should be the <code>anonymous type</code> which would contain weekly data + current day data and that i update cache with the new <code>anonymous type</code> which would contain combined result of two anonymous instances.</p>