Exemplo n.º 1
0
        public IHttpActionResult GetRestriction(string oc)
        {
            Restriction restriction = db.Oc.Find(1);

            if (restriction == null)
            {
                return(NotFound());
            }
            if (oc.Equals("open"))
            {
                restriction.Oc = "open";
            }
            else
            {
                restriction.Oc = "close";
            }

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

            db.SaveChanges();

            return(Ok(restriction));
        }