Beispiel #1
0
        public async Task <IHttpActionResult> PutContenedores_504(int id, Contenedores_504 contenedores_504)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public async Task <IHttpActionResult> GetContenedores_504(int id)
        {
            Contenedores_504 contenedores_504 = await db.Contenedores_504.FindAsync(id);

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

            return(Ok(contenedores_504));
        }
Beispiel #3
0
        public async Task <IHttpActionResult> PostContenedores_504(Contenedores_504 contenedores_504)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Contenedores_504.Add(contenedores_504);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = contenedores_504.id }, contenedores_504));
        }
Beispiel #4
0
        public async Task <IHttpActionResult> DeleteContenedores_504(int id)
        {
            Contenedores_504 contenedores_504 = await db.Contenedores_504.FindAsync(id);

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

            db.Contenedores_504.Remove(contenedores_504);
            await db.SaveChangesAsync();

            return(Ok(contenedores_504));
        }