public async Task <IActionResult> PutStudentCourse(int id, StudentCourse studentCourse) { if (id != studentCourse.StudentId) { return(BadRequest()); } _context.Entry(studentCourse).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentCourseExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTeacher(int id, Teacher teacher) { if (id != teacher.Id) { return(BadRequest()); } _context.Entry(teacher).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TeacherExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }