Exemplo n.º 1
0
        public IHttpActionResult PutSymp_Des(int id, Symp_Des symp_Des)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetSymp_Des(int id)
        {
            Symp_Des symp_Des = db.Symp_Des.Find(id);

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

            return(Ok(symp_Des));
        }
Exemplo n.º 3
0
        public IHttpActionResult PostSymp_Des(Symp_Des symp_Des)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Symp_Des.Add(symp_Des);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = symp_Des.Symp_Des_ID }, symp_Des));
        }
Exemplo n.º 4
0
        public IHttpActionResult GetSymp_Des(int id)
        {
            db.Configuration.ProxyCreationEnabled = false;
            Symp_Des symp_Des = db.Symp_Des.Find(id);

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

            return(Ok(symp_Des));
        }
Exemplo n.º 5
0
        public IHttpActionResult DeleteSymp_Des(int id)
        {
            Symp_Des symp_Des = db.Symp_Des.Find(id);

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

            db.Symp_Des.Remove(symp_Des);
            db.SaveChanges();

            return(Ok(symp_Des));
        }
Exemplo n.º 6
0
        public IHttpActionResult DeleteSymp_Des(int id)
        {
            db.Configuration.ProxyCreationEnabled = false;
            Symp_Des symp_Des = db.Symp_Des.Find(id);

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

            db.Symp_Des.Remove(symp_Des);
            db.SaveChanges();

            return(Ok(symp_Des));
        }