public async Task <IActionResult> AddLecture(int SecId, Lecture lecture) { if (SecId > 0) { if (_db.GetCourseSection(SecId) != null) { IEnumerable <Lecture> courseLecture = await _db.AddLecture(SecId, lecture); if (courseLecture != null) { return(Ok(courseLecture)); } } return(BadRequest("Not Found")); } return(BadRequest("Error")); }