Beispiel #1
0
        // DELETE /api/students/
        public IHttpActionResult DeleteStudent(int id)
        {
            studentsService = new StudentsService();

            studentsService.DeleteStudent(id);

            // delete all student subjects

            List <StudentToExpose> allStudents = studentsService.GetAllEnrolledStudents();

            return(Ok(allStudents));
        }
Beispiel #2
0
        // GET /api/students/
        public IHttpActionResult GetEnrolledStudents()
        {
            studentsService = new StudentsService();

            List <StudentToExpose> allStudents = studentsService.GetAllEnrolledStudents();

            if (allStudents.Count() == 0)
            {
                return(NotFound());
            }

            return(Ok(allStudents));
        }