public async Task <IActionResult> GetCourseContents(int courseId) { if (courseId < 1) { return(BadRequest()); } var course = await _courseService.GetCourseByIdAsync(courseId); var chapters = await _chapterService.GetChaptersOfCourseAsync(courseId); var model = _courseConverter.ToCourseContentsModel(course, chapters); return(Ok(model)); }