Exemplo n.º 1
0
        public async Task <IHttpActionResult> Putiot_pma_estacion(int id, iot_pma_estacion iot_pma_estacion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> Getiot_pma_estacion(int id)
        {
            iot_pma_estacion iot_pma_estacion = await db.iot_pma_estacion.FindAsync(id);

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

            return(Ok(iot_pma_estacion));
        }
Exemplo n.º 3
0
        public async Task <IHttpActionResult> Postiot_pma_estacion(iot_pma_estacion iot_pma_estacion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            return(CreatedAtRoute("DefaultApi", new { id = iot_pma_estacion.id }, iot_pma_estacion));
        }
Exemplo n.º 4
0
        public async Task <IHttpActionResult> Deleteiot_pma_estacion(int id)
        {
            iot_pma_estacion iot_pma_estacion = await db.iot_pma_estacion.FindAsync(id);

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

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

            return(Ok(iot_pma_estacion));
        }