public async Task <IHttpActionResult> PutCPGFD_Users(int id, CPGFD_Users cPGFD_Users) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cPGFD_Users.UserID) { return(BadRequest()); } db.Entry(cPGFD_Users).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CPGFD_UsersExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetCPGFD_Users(int id) { CPGFD_Users cPGFD_Users = await db.CPGFD_Users.FindAsync(id); if (cPGFD_Users == null) { return(NotFound()); } return(Ok(cPGFD_Users)); }
public async Task <IHttpActionResult> PostCPGFD_Users(CPGFD_Users cPGFD_Users) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CPGFD_Users.Add(cPGFD_Users); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = cPGFD_Users.UserID }, cPGFD_Users)); }
public async Task <IHttpActionResult> DeleteCPGFD_Users(int id) { CPGFD_Users cPGFD_Users = await db.CPGFD_Users.FindAsync(id); if (cPGFD_Users == null) { return(NotFound()); } db.CPGFD_Users.Remove(cPGFD_Users); await db.SaveChangesAsync(); return(Ok(cPGFD_Users)); }