public async Task <ActionResult <CTeamRole> > PostCTeamRole(CTeamRole cTeamRole) { _context.CTeamRole.Add(cTeamRole); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCTeamRole", new { id = cTeamRole.Id }, cTeamRole)); }
public async Task <IActionResult> PutCTeamRole(int id, CTeamRole cTeamRole) { if (id != cTeamRole.Id) { return(BadRequest()); } _context.Entry(cTeamRole).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CTeamRoleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }