Ejemplo n.º 1
0
        public IHttpActionResult PutBodyAnalizeResult(int id, BodyAnalizeResult bodyAnalizeResult)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BodyAnalizeResultExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetBodyAnalizeResult(int id)
        {
            BodyAnalizeResult bodyAnalizeResult = db.BodyAnalizeResult.Find(id);

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

            return(Ok(bodyAnalizeResult));
        }
Ejemplo n.º 3
0
        public IHttpActionResult PostBodyAnalizeResult(BodyAnalizeResult bodyAnalizeResult)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.BodyAnalizeResult.Add(bodyAnalizeResult);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = bodyAnalizeResult.ID }, bodyAnalizeResult));
        }
Ejemplo n.º 4
0
        public IHttpActionResult DeleteBodyAnalizeResult(int id)
        {
            BodyAnalizeResult bodyAnalizeResult = db.BodyAnalizeResult.Find(id);

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

            db.BodyAnalizeResult.Remove(bodyAnalizeResult);
            db.SaveChanges();

            return(Ok(bodyAnalizeResult));
        }