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> GetCPGFD_UsersInRoles(int id) { CPGFD_UsersInRoles cPGFD_UsersInRoles = await db.CPGFD_UsersInRoles.FindAsync(id); if (cPGFD_UsersInRoles == null) { return(NotFound()); } return(Ok(cPGFD_UsersInRoles)); }
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)); }
public async Task <IHttpActionResult> DeleteCPGFD_UsersInRoles(int id) { CPGFD_UsersInRoles cPGFD_UsersInRoles = await db.CPGFD_UsersInRoles.FindAsync(id); if (cPGFD_UsersInRoles == null) { return(NotFound()); } db.CPGFD_UsersInRoles.Remove(cPGFD_UsersInRoles); await db.SaveChangesAsync(); return(Ok(cPGFD_UsersInRoles)); }