public ICollection <Student_GetAll_Result> StudentsGetAll() { using (var db = new CourseRegistrationDbEntities()) { return(db.Student_GetAll().ToList()); } }
//Students get by Id public Students_GetById_Result StudentGetById(int id) { using (var db = new CourseRegistrationDbEntities()) { return(db.Students_GetById(id).SingleOrDefault()); } }
public ICollection <Courses_GetStudents_Result> GetCourseStudents(int courseId) { using (var db = new CourseRegistrationDbEntities()) { return(db.Courses_GetStudents(courseId).ToList()); } }
public ICollection <Courses_GetAll_Result> GetAllCourses() { using (var db = new CourseRegistrationDbEntities()) { return(db.Courses_GetAll().ToList()); } }
public bool RegisterStudent(int courseId, RegisterStudentCourseRequestModel model) { using (var db = new CourseRegistrationDbEntities()) { db.Course_RegisterStudent(courseId, model.StudentId, model.Semester, model.AcademicYear); return(true); } }