title: How to pass field value to nested object from parent when using automapper?
body: <p>I'm trying to map objects with automapper.</p>
  
  <p>My input model:</p>
  
  <pre><code>public class Input
  {
      public int ID { get; set; }
      public ICollection&lt;NestedObject&gt; NestedObjects { get; set; }
  }
  public class NestedObject
  {
      public string SomeString { get; set; }
  }
  </code></pre>
  
  <p>My output model:</p>
  
  <pre><code>public class Output
  {
      public int ID { get; set; }
      public ICollection&lt;OutputNestedObject&gt; OutputNestedObjects { get; set; }
  }
  
  public class OutputNestedObject
  {
      public int InputID { get; set; }
      public string SomeString { get; set; }
  }
  </code></pre>
  
  <p>My mapping code:</p>
  
  <pre><code>[Test]
  public void TestNesting()
  {
      var mapper = new MapperConfiguration(cfg =&gt;
      {
          cfg.CreateMap&lt;Input, Output&gt;()
              .ForMember(x=&gt; x.OutputNestedObjects, src=&gt; src.MapFrom(x=&gt; x.NestedObjects))
              ;
      }).CreateMapper();
  
      var input = new Input()
      {
          ID = 111,
          NestedObjects = new List&lt;NestedObject&gt;()
          {
              new NestedObject(){SomeString = "sometext"},
          }
      };
  
      var output = mapper.Map&lt;Output&gt;(input);
  
      Assert.AreEqual(input.ID, output.ID);
  
      var inputNested = input.NestedObjects.First();
      var outputNested = output.OutputNestedObjects.First();
  
      Assert.AreEqual(input.ID, outputNested.InputID);
      Assert.AreEqual(inputNested.SomeString, outputNested.SomeString);
  
  }
  </code></pre>
  
  <p>Now i'm having AutoMapperMappingException:</p>
  
  <p><code>Unmapped properties:
  InputID</code></p>
  
  <p>I want to get object of Output with nested OutputNestedObject with id of Input object. How to do this? </p>
  
  <p>Thanks in advance!</p>