【发布时间】:2016-12-06 15:28:09
【问题描述】:
我有两个类对象的数据视图模型。
public class StudentViewModel
{
public PeopleEntity People { get; set; }
public PeopleUnitEntity PeopleUnit { get; set; }
}
在下面的代码中,我得到了 PeopleEntity 和 PeopleUnitEntity 的值
IList<StudentViewModel> _stv = _StudentServicesObject.GetStudentByPersonCode(PersonCode);
我只想在新的 PeopleEntity 对象中存储人员列表,我该怎么做???
我尝试了以下方法,但它对我不起作用
IList<PeopleEntity> _People = _StudentServicesObject.GetStudentByPersonCode(PersonCode).Select(pl => new PeopleEntity { People = pl });
错误
【问题讨论】:
-
为什么不 .ToList()