Here is my custom Type Converter.
public class StringListTypeConverter : TypeConverter<String, IEnumerable<String>>
{
protected override IEnumerable<string> ConvertCore(String source)
{
if (source == null)
yield break;
foreach (var item in source.Split(','))
yield return item.Trim();
}
}
public class Source
{
public String Some {get;set;}
}
public class Dest
{
public IEnumerable<String> Some {get;set;}
}
// ... configuration
Mapper.CreateMap<String, IEnumerable<String>>().ConvertUsing<StringListTypeConverter>();
Mapper.CreateMap<Source, Dest>();
The problem: StringListTypeConverter
is not being called at all. Dest.Some == null
.
Update: Automapper version 1.0.0.155