I have the following model:
public class Tag
{
public int Id { get; set; }
public string Name { get; set; }
}
I want to be able to
ForMember means you are providing mapping for a member where you want a mapping between type. Instead, use this :
Mapper.CreateMap().ConvertUsing();
And Converter is
public class TagToStringConverter : ITypeConverter
{
public string Convert(ResolutionContext context)
{
return (context.SourceValue as Tag).Name ?? string.Empty;
}
}