public static TeacherDTO TeacherConvertDTO(Teacher t) {// if (t == null) { return(null); } List <CourseDTO> course = new List <CourseDTO>(); foreach (var item in t.Courses) { course.Add(CourseDTO.CourseConvertDTO(item)); } return(new TeacherDTO() { TeacherId = t.TeacherId, TeacherName = t.TeacherName, TeacherEmail = t.TeacherEmail, TeacherPhone = t.TeacherPhone, TeacherAge = t.TeacherAge, Describe = t.Describe, Password = t.Password, UserNmae = t.UserNmae, Course = course }); }
public static Course CourseConvertDAL(CourseDTO d) { return(new Course() { CourseId = d.CourseId, CourseName = d.CourseName, CourseDescribe = d.CourseDescribe, Proffestion = d.Proffestion, MinUseres = d.MinUseres, MaxUseres = d.MaxUseres, IdTeacher = d.IdTeacher, CoursePrice = d.CoursePrice // Teacher=TeacherDTO.TeacherConvertDTO(d.Teacher) }); }