将dto映射到复杂实体



如何将复杂的UploadDTO映射到实体编号?

public class UploadDTO
{
    public CustomerDTO Customer { get; set; }
    public MachineDTO Machine { get; set; }
    public NumberDTO Number { get; set; }
}
public class Number
{
    public Customer Customer { get; set; }
    public Machine Machine { get; set; }
}

更新
Mapper.CreateMap<CustomerDTO , Customer >();
 Mapper.CreateMap<MachineDTO , Machine >();
 Mapper.CreateMap<NumberDTO , Number>();

问题是,UploadDTO映射丢失,所以它不工作。但是我怎么说:"take UploadDTO。比如客户对客户?"

将缺失的映射从UploadDTO添加到Number:

Mapper.CreateMap<UploadDTO , Number>();

相关内容

  • 没有找到相关文章

最新更新