public class DocumentObjectConverter : ITypeConverter<DocumentObject, DocumentObject>
{
public DocumentObject Convert(DocumentObject source, DocumentObject destination, ResolutionContext context)
{
//destination = new DocumentObject(); // I have to manually create this but I would like to create the derived object.
foreach (string prop in source.GetDynamicMemberNames())
{
destination[prop] = source[prop];
}
return destination;
}
}
I have the following custom converter.
This is how I configured:
Expected Behavior: In DocumentObjectConverter, destination object has been created. So the Convert method, just does the conversion of the attributes.