public async Task <ActionResult <HrmEmployeeGroup> > PostHrmEmployeeGroup(HrmEmployeeGroup hrmEmployeeGroup) { _context.HrmEmployeeGroups.Add(hrmEmployeeGroup); await _context.SaveChangesAsync(); return(CreatedAtAction("GetHrmEmployeeGroup", new { id = hrmEmployeeGroup.Id }, hrmEmployeeGroup)); }
public async Task <IActionResult> PutHrmEmployeeGroup(int id, HrmEmployeeGroup hrmEmployeeGroup) { if (id != hrmEmployeeGroup.Id) { return(BadRequest()); } _context.Entry(hrmEmployeeGroup).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HrmEmployeeGroupExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }