title: Using AutoMapper to map the property of an object to a string
body: <p>I have the following model:</p>
  
  <pre><code>public class Tag
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>I want to be able to use AutoMapper to map the <code>Name</code> property of the <code>Tag</code> type to a string property in one of my viewmodels.</p>
  
  <p>I have created a custom resolver to try to handle this mapping, using the following code:</p>
  
  <pre><code>public class TagToStringResolver : ValueResolver&lt;Tag, string&gt;
      {
          protected override string ResolveCore(Tag source)
          {
              return source.Name ?? string.Empty;
          }
      }
  </code></pre>
  
  <p>I am mapping using the following code:</p>
  
  <pre><code>Mapper.CreateMap&lt;Tag, String&gt;()
      .ForMember(d =&gt; d, o =&gt; o.ResolveUsing&lt;TagToStringResolver&gt;());
  </code></pre>
  
  <p>When I run the application I get the error:</p>
  
  <blockquote>
    <p>Custom configuration for members is only supported for top-level
    individual members on a type.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>