public async Task<IHttpActionResult> PutCPGFD_ErrorExceptions(int id, CPGFD_ErrorExceptions cPGFD_ErrorExceptions) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != cPGFD_ErrorExceptions.ID) { return BadRequest(); } db.Entry(cPGFD_ErrorExceptions).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CPGFD_ErrorExceptionsExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public async Task<IHttpActionResult> PostCPGFD_ErrorExceptions(CPGFD_ErrorExceptions cPGFD_ErrorExceptions) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.CPGFD_ErrorExceptions.Add(cPGFD_ErrorExceptions); await db.SaveChangesAsync(); return CreatedAtRoute("DefaultApi", new { id = cPGFD_ErrorExceptions.ID }, cPGFD_ErrorExceptions); }