public async Task <IActionResult> DeleteLinkToCourse([FromBody] string _CourseName) { try { var CourseID = _courseService.GetCourseIdByName(_CourseName); var UserID = Guid.Parse(User.GetLoggedInUserId <string>()); var TeacherID = _teacherService.GetTeacherIDByUserID(UserID); var teacherCourse = await _teacherService.DeleteLinkToCourse(CourseID, TeacherID); return(Ok("Link Deleted")); } catch (Exception e) { return(BadRequest(e.Message)); } }