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