这里是我的数据传输对象传递DTO,将视图模型
public class LoadSourceDetail
{
public string LoadSourceCode { get; set; }
public string LoadSourceDesc { get; set; }
public IEnumerable<ReportingEntityDetail> ReportingEntity { get; set; }
}
public class ReportingEntityDetail
{
public string ReportingEntityCode { get; set; }
public string ReportingEntityDesc { get; set; }
}
这里是我的ViewModel
}
我不知道如何将数据从LoadSourceDetail转移ReportingEntity到LoadSourceViewModel ReportingEntity。我试图从一个IEnumerable传输数据到另一个IEnumerable。
我用automapper为我所有的映射和的ViewModels –
感谢您的建议,但我'想知道如何在没有AutoMapper的情况下手动执行此操作。 –
没问题,对我来说这将是一个带有To()和From()方法的老式DTO。我会在那里留下我的答案,因为这是我现在要做的方式。 – hutchonoid