public async Task <IHttpActionResult> Putiot_pma_distrito(int id, iot_pma_distrito iot_pma_distrito) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iot_pma_distrito.id) { return(BadRequest()); } db.Entry(iot_pma_distrito).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!iot_pma_distritoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> Getiot_pma_distrito(int id) { iot_pma_distrito iot_pma_distrito = await db.iot_pma_distrito.FindAsync(id); if (iot_pma_distrito == null) { return(NotFound()); } return(Ok(iot_pma_distrito)); }