public async Task <IActionResult> PutCanBoBenhVien(int id, CanBoBenhVien canBoBenhVien) { if (id != canBoBenhVien.Id) { return(BadRequest()); } _context.Entry(canBoBenhVien).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CanBoBenhVienExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <CanBoBenhVien> > PostCanBoBenhVien(CanBoBenhVien canBoBenhVien) { _context.CanBoBenhViens.Add(canBoBenhVien); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCanBoBenhVien", new { id = canBoBenhVien.Id }, canBoBenhVien)); }