示例#1
0
        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));
        }
示例#2
0
        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));
        }