title: AutoMapper and manually mapping nested complex types
body: <p>I have complex data, that is returned from my API as follows:</p>
  
  <pre><code>"id": 1002,
  "user_id": "98fd8f37-383d-4fe7-9b88-18cc8a8cd9bf",
  "organization_id": null,
  "content": "A post with a hashtag!",
  "created_at": "2018-05-25T21:35:31.5218467",
  "modified_at": "2018-05-25T21:35:31.5218467",
  "can_comment": true,
  "can_share": true,
  "post_tags": [
      {
          "post_id": 1002,
          "tag_id": 1,
          "tag": {
              "id": 1,
              "value": "hashtag",
              "post_tags": []
          }
      }
  ]
  </code></pre>
  
  <p>That corresponds to my <code>Post.cs</code> entity, and I created new model class to map it with, which looks like this:</p>
  
  <pre><code>public class PostModel
  {
      public int Id { get; set; }
  
      [Required]
      public string UserId { get; set; }
  
      public int? OrganizationId { get; set; }
  
      [Required]
      public string Content { get; set; }
  
      public DateTime CreatedAt { get; set; }
  
      public DateTime ModifiedAt { get; set; }
  
      public bool CanComment { get; set; } = true;
  
      public bool CanShare { get; set; } = true;
  
      public List&lt;Tag&gt; Tags { get; set; }
  }
  </code></pre>
  
  <p>Where my <code>Tag.cs</code> and <code>TagModel.cs</code> classes lookk like this:</p>
  
  <p><strong>Tag.cs:</strong></p>
  
  <pre><code>public class Tag
  {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int Id { get; set; }
  
      public string Value { get; set; }
  
      public ICollection&lt;PostTag&gt; PostTags { get; set; } = new List&lt;PostTag&gt;();
  }
  </code></pre>
  
  <p><strong>TagModel.cs:</strong></p>
  
  <pre><code>public int Id { get; set; }
  
  [Required]
  public string Value { get; set; }
  </code></pre>
  
  <p>So, basically, I have a mapping as </p>
  
  <pre><code>CreateMap&lt;Post, PostModel&gt;()
      .ReverseMap();
  CreateMap&lt;Tag, TagModel&gt;()
      .ReverseMap();
  </code></pre>
  
  <p>but what I get from the API once I do the mapping is this:</p>
  
  <pre><code>"id": 1002,
  "user_id": "98fd8f37-383d-4fe7-9b88-18cc8a8cd9bf",
  "organization_id": null,
  "content": "Finally a post with a hashtag!",
  "created_at": "2018-05-25T21:35:31.5218467",
  "modified_at": "2018-05-25T21:35:31.5218467",
  "can_comment": true,
  "can_share": true,
  "tags": null
  </code></pre>
  
  <p>So, as you can see the <code>Tags</code> is not mapped. The reason is more likely that I have a many-to-many relationship between <code>Post</code> and <code>Tag</code>, and I originally get <code>PostTags</code> from the API. How can I tell AutoMapper to map the <code>tag</code> inside <code>post_tags</code> to the corresponding tag inside <code>PostModel</code>?</p>