public async Task <ActionResult <HrmEmployee> > PostHrmEmployee(HrmEmployee hrmEmployee) { _context.HrmEmployees.Add(hrmEmployee); await _context.SaveChangesAsync(); return(CreatedAtAction("GetHrmEmployee", new { id = hrmEmployee.Id }, hrmEmployee)); }
public async Task <IActionResult> PutHrmEmployee(int id, HrmEmployee hrmEmployee) { if (id != hrmEmployee.Id) { return(BadRequest()); } _context.Entry(hrmEmployee).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HrmEmployeeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }