title: how to map an anonymous object to a class by AutoMapper?
body: <p>I have an entity:</p>
  
  <pre><code>public class Tag {
      public int Id { get; set; }
      public string Word { get; set; }
      // other properties...
      // and a collection of blogposts:
      public ICollection&lt;Post&gt; Posts { get; set; }
  }
  </code></pre>
  
  <p>and a model:</p>
  
  <pre><code>public class TagModel {
      public int Id { get; set; }
      public string Word { get; set; }
      // other properties...
      // and a collection of blogposts:
      public int PostsCount { get; set; }
  }
  </code></pre>
  
  <p>and I query the entity like this (by <strong>EF</strong> or <strong>NH</strong>):</p>
  
  <pre><code>var tagsAnon = _context.Tags
      .Select(t =&gt; new { Tag = t, PostsCount = t. Posts.Count() })
      .ToList();
  </code></pre>
  
  <p>Now, how can I map the <code>tagsAnon</code> (as an <em>anonymous object</em>) to a collection of <code>TagModel</code> (e.g. <code>ICollection&lt;TagModel&gt;</code> or <code>IEnumerable&lt;TagModel&gt;</code>)? Is it possible?</p>