public GradeCourseEntity(DataAccessLogic.tblGradeCourse gradeCourse) { this.ID = gradeCourse.ID; this.Course = new CourseEntity(gradeCourse.tblCourse); this.Grade = new GradeEntity(gradeCourse.tblGrade); this.Teacher = new TeacherEntity(gradeCourse.tblTeacher); this.CreatedBy = gradeCourse.CreatedBy; this.CreatedDate = gradeCourse.CreatedDate; }
public T MapToModel <T>() where T : class { DataAccessLogic.tblGradeCourse gradeCourse = new DataAccessLogic.tblGradeCourse(); gradeCourse.ID = this.ID; gradeCourse.CourseID = this.Course.ID; gradeCourse.GradeID = this.Grade.ID; gradeCourse.TeacherID = this.Teacher.ID; gradeCourse.CreatedBy = this.CreatedBy; gradeCourse.CreatedDate = this.CreatedDate; return(gradeCourse as T); }