public async Task <IActionResult> PutLecAndStudent(int id, LecAndStudent lecAndStudent) { if (id != lecAndStudent.Id) { return(BadRequest()); } _context.Entry(lecAndStudent).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LecAndStudentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAca(int id, Aca aca) { if (id != aca.Id) { return(BadRequest()); } _context.Entry(aca).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AcaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Put([FromBody] Student value) { _context.Entry(value).State = EntityState.Added; _context.SaveChanges(); }