Source:
internal class ProductSupplierReportMiddle
{
public ProductSupplierReport ProductSupplierReport { get; set; }
public BaseEndProductProduceOrder EndProductProduceOrder { get; set; }
}
Destination:
public class ProductSupplierReportDto
{
public Guid UUID{ get; set; }
public string BillCode { get; set; }
public DateTime BillDate { get; set; }
public string SourceOrderCode{ get; set; }
}
The current approach I can think
CreateMap<ProductSupplierReportMiddle, ProductSupplierReportDto>()
.ForMember(dto => dto.UUID, opts => opts.MapFrom(e => e.ProductSupplierReport.UUID))
.ForMember(dto => dto.BillCode, opts => opts.MapFrom(e => e.ProductSupplierReport.BillCode))
.ForMember(dto => dto.BillDate, opts => opts.MapFrom(e => e.ProductSupplierReport.BillDate))
.ForMember(dto => dto.SourceOrderCode, opts => opts.MapFrom(e => e.EndProductProduceOrder.BillCode))
can i Omit it the ProductSupplierReport map,because i have many same file
1