두 클래스 개체가있는 viewModel 데이터가 있습니다. 내가 PeopleEntity 및 PeopleUnitEntityC# ViewModel에서 클래스 개체 목록 가져 오기
IList<StudentViewModel> _stv = _StudentServicesObject.GetStudentByPersonCode(PersonCode);
나는 새로운 PeopleEntity 개체 만 사람들 목록을 저장할 모두에 대한 값을 얻을 코드를 다음에서
public class StudentViewModel
{
public PeopleEntity People { get; set; }
public PeopleUnitEntity PeopleUnit { get; set; }
}
, 내가 그걸 어떻게 할 수 ???
나는 다음과 같은 시도했지만 나를 위해 작동하지 않습니다IList<PeopleEntity> _People = _StudentServicesObject.GetStudentByPersonCode(PersonCode).Select(pl => new PeopleEntity { People = pl });
오류
왜 안 되니 .ToList() –