public async Task <bool> SignUpToCourseAsync(int studentId, int courseId) { var student = await _studentRepository.GetByIdAsync(studentId); var course = await _courseRepository.GetByIdAsync(courseId); return(await _courseRepository.AddStudentAsync(course, student)); }
public async Task <ActionResult> AddStudent(long courseId, long studentId) { await repository.AddStudentAsync(courseId, studentId); return(CreatedAtAction(nameof(AddStudent), new { courseId, studentId }, null)); }