public async Task <IHttpActionResult> PutStatus_Reclamation(int id, Status_Reclamation status_Reclamation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != status_Reclamation.IdStatus_Reclamation) { return(BadRequest()); } db.Entry(status_Reclamation).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Status_ReclamationExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetStatus_Reclamation(int id) { Status_Reclamation status_Reclamation = await db.Status_Reclamation.FindAsync(id); if (status_Reclamation == null) { return(NotFound()); } return(Ok(status_Reclamation)); }
public async Task <IHttpActionResult> PostStatus_Reclamation(Status_Reclamation status_Reclamation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Status_Reclamation.Add(status_Reclamation); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = status_Reclamation.IdStatus_Reclamation }, status_Reclamation)); }
public async Task <IHttpActionResult> DeleteStatus_Reclamation(int id) { Status_Reclamation status_Reclamation = await db.Status_Reclamation.FindAsync(id); if (status_Reclamation == null) { return(NotFound()); } db.Status_Reclamation.Remove(status_Reclamation); await db.SaveChangesAsync(); return(Ok(status_Reclamation)); }