Предположим, что у меня есть два класса:
public class Student
{
public int Id {get; set;}
public string Name {get; set;}
public IList<Course> Courses{ get; set;}
}
public class StudentDTO
{
public int Id {get; set;}
public string Name {get; set;}
public IList<CourseDTO> Courses{ get; set;}
}
Я хотел бы скопировать значение из класса Student в класс StudentDTO:
var student = new Student();
StudentDTO studentDTO = student;
Как я могу сделать это путем отражения или другого решения?