title: Mapping A Property Of List<T> Using Automapper
body: <p>Using Automapper, I want to map a property that is a List of type Employee using string.Join() to product a comma-delimited string of the names of an employee's rights. Here are the classes I'm using:</p>
  
  <pre><code>public class MappedEmployee
  {
      public string Name { get; set; }
      public string RightNames { get; set; }
  }
  
  public class Employee
  {
      public string Name { get; set; }
      public List&lt;Right&gt; Rights { get; set; }
  }
  
  public class Right
  {
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>And here is the code I have:</p>
  
  <pre><code>Mapper.CreateMap&lt;Employee, MappedEmployee&gt;()
      .ForMember(d =&gt; d.RightNames, o =&gt; o.MapFrom(s =&gt; s.Rights.SelectMany(r =&gt; string.Join(", ", r.Name))));
  
  var employee = new Employee
  {
      Name = "Joe Schmoe",
      Rights = new List&lt;Right&gt;
      {
          new Right { Name = "Admin" },
          new Right { Name = "User" },
      }
  };
  
  var mappedEmployee = Mapper.Map&lt;Employee, MappedEmployee&gt;(employee);
  </code></pre>
  
  <p>However, this it's producing the folowing:</p>
  
  <pre><code>System.Linq.Enumerable+&lt;SelectManyIterator&gt;d__14`2[Employee.Right,System.Char]
  </code></pre>
  
  <p>What can I do do get a comma-delimited string of the Employee's rights?</p>