我正在使用自动映射器来映射源对象和目标对象。当我映射他们时,我得到下面的错误。自动映射表达式必须解析为顶层成员
表达式必须解析为顶级成员。参数名称:lambda表达式
我无法解决问题。
我的源和目标对象是:
public partial class Source
{
private Car[] cars;
public Car[] Cars
{
get { return this.cars; }
set { this.cars = value; }
}
}
public partial class Destination
{
private OutputData output;
public OutputData Output
{
get { return this.output; }
set { this.output= value; }
}
}
public class OutputData
{
private List<Cars> cars;
public Car[] Cars
{
get { return this.cars; }
set { this.cars = value; }
}
}
我必须与Destination.OutputData.Cars
对象映射Source.Cars
。你能帮我解决吗?
您可以添加automapper配置吗? – k0stya 2012-07-24 19:54:29
我试图添加配置,它在运行配置时抛出错误。我的配置如下所示:Mapper.CreateMap