Beispiel #1
0
        public IHttpActionResult Post(workout_Category obj)
        {
            db.workout_Category.Add(obj);

            int objvar = db.SaveChanges();

            if (objvar > 0)
            {
                return(StatusCode(HttpStatusCode.Created));
            }
            {
                return(BadRequest("not exist"));
            }
        }
Beispiel #2
0
        public IHttpActionResult Put(workout_Category obj)
        {
            db.workout_Category.Attach(obj);
            db.Entry(obj).State = System.Data.Entity.EntityState.Modified;
            var r = db.SaveChanges();

            if (r > 0)
            {
                return(StatusCode(HttpStatusCode.Accepted));
            }
            else
            {
                return(BadRequest("not exust"));
            }
        }