public async Task <IActionResult> PutUtilizator(long id, Utilizator utilizator) { if (id != utilizator.Id) { return(BadRequest()); } _context.Entry(utilizator).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UtilizatorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAngajat(long id, Angajat angajat) { if (id != angajat.Id_Angajat) { return(BadRequest()); } _context.Entry(angajat).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AngajatExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }