public IActionResult AddCourseEnrollment(int crsId, int stdId) { if (_db.GetStudentById(stdId) == null && _db.GetCourseById(crsId) == null) { NotFound("Check Your Data"); } else { Course EnrolledCourse = _db.AddCourseEnrollment(crsId, stdId); return(Ok(EnrolledCourse)); } return(BadRequest()); }