title: How to map an object's properties to an ordered list of objects?
body: <p>How can one map an object's properties to an ordered list of objects using automapper? The source type and it's properties are known at compile time. The index at which each property should be in the destination must be resolved at runtime. Validation that every source property is mapped is important.</p>
  <p>Consider this example of what I'm trying to achieve:</p>
  <pre><code>public class Employee
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public int Id { get; set; }
  }
  
  var configuration = new MapperConfiguration(cfg =&gt;
  {
      var map = cfg.CreateMap&lt;Employee, List&lt;object&gt;&gt;(MemberList.Source);
      //  some map configuration should go here.
      //  Preferrably one that maps a source property to an object in list at specified index.
  }
  configuration.AssertConfigurationIsValid();
  var mapper = configuration.CreateMapper();
  listOfProperties = mapper.Map(new Employee() { FirstName = &quot;foo&quot;, LastName = &quot;bar&quot;, Id = 0 });
  // listOfProperties is a list of elements: { 0, &quot;foo&quot;, &quot;bar&quot; };
  // Order of elements in list should be a part of configuration
  </code></pre>
  <p>Can something like that be accomplished with automapper at all? If there is more than one suitable way to accomplish this, what are they?</p>