Esempio n. 1
0
        public async Task <IHttpActionResult> Putiot_pma_medida(int id, iot_pma_medida iot_pma_medida)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != iot_pma_medida.id)
            {
                return(BadRequest());
            }

            db.Entry(iot_pma_medida).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!iot_pma_medidaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> Getiot_pma_medida(int id)
        {
            iot_pma_medida iot_pma_medida = await db.iot_pma_medida.FindAsync(id);

            if (iot_pma_medida == null)
            {
                return(NotFound());
            }

            return(Ok(iot_pma_medida));
        }
Esempio n. 3
0
        public async Task <IHttpActionResult> Postiot_pma_medida(iot_pma_medida iot_pma_medida)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.iot_pma_medida.Add(iot_pma_medida);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = iot_pma_medida.id }, iot_pma_medida));
        }
Esempio n. 4
0
        public async Task <IHttpActionResult> Deleteiot_pma_medida(int id)
        {
            iot_pma_medida iot_pma_medida = await db.iot_pma_medida.FindAsync(id);

            if (iot_pma_medida == null)
            {
                return(NotFound());
            }

            db.iot_pma_medida.Remove(iot_pma_medida);
            await db.SaveChangesAsync();

            return(Ok(iot_pma_medida));
        }