C# 自动映射将类型A的源属性映射到目标列表

C# 自动映射将类型A的源属性映射到目标列表,c#,automapper,C#,Automapper,我的问题是,我需要将类型A转换为类型B和所有嵌套类型!并同时将单个对象“a”转换为对象“B”列表 public class SourcePoco { public ComplexTypeA MyProblem { get; set; } // there be more properties... } public class ComplexTypeA { // ...more nested complex types } 我现在的问题是如何将我的问题映射到以下目标类

我的问题是,我需要将类型A转换为类型B和所有嵌套类型!并同时将单个对象“a”转换为对象“B”列表

public class SourcePoco
{
    public ComplexTypeA MyProblem { get; set; }
    // there be more properties...
}

public class ComplexTypeA
{
    // ...more nested complex types
}
我现在的问题是如何将我的问题映射到以下目标类型:

public class DestinationPoco
{
    public IEnumerable<ComplexTypeB> MyProblems { get; set; }
    // there be more properties...
}
我有以下映射:

CreateMap<SourcePoco, DestinationPoco>()
   .ForMember(...);

CreateMap<ComplexTypeA , ComplexTypeB>()
   .ForMember(dest => dest.Id, opt => opt.Ignore());

CreateMap<ComplexTypeA, IEnumerable<ComplexTypeB>>()
    .ConvertUsing<MyProblemConverter>();

我尝试添加类似的内容,但从未被调用。

删除该转换器。试一试

CreateMap.ForMemberd=>MyProblems,o=>o.MapFroms=>new[]{s.MyProblems}