public async Task<IHttpActionResult> PutCPGFD_UsersInRoles(int id, CPGFD_UsersInRoles cPGFD_UsersInRoles) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != cPGFD_UsersInRoles.RoleID) { return BadRequest(); } db.Entry(cPGFD_UsersInRoles).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CPGFD_UsersInRolesExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public async Task<IHttpActionResult> PostCPGFD_UsersInRoles(CPGFD_UsersInRoles cPGFD_UsersInRoles) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.CPGFD_UsersInRoles.Add(cPGFD_UsersInRoles); await db.SaveChangesAsync(); return CreatedAtRoute("DefaultApi", new { id = cPGFD_UsersInRoles.RoleID }, cPGFD_UsersInRoles); }