コード例 #1
0
        public IHttpActionResult Putapply(int id, apply apply)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #2
0
 //function should takea gameObject and an index
 public void applyToAll(apply func)
 {
     for (int i = 0; i < all.Count; i++)
     {
         func(all[i] as GameObject, i);
     }
 }
コード例 #3
0
        public IHttpActionResult Getapply(int id)
        {
            apply apply = db.apply.Find(id);

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

            return(Ok(apply));
        }
コード例 #4
0
        public IHttpActionResult Postapply(apply apply)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.apply.Add(apply);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = apply.app_id }, apply));
        }
コード例 #5
0
        public IHttpActionResult Deleteapply(int id)
        {
            apply apply = db.apply.Find(id);

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

            db.apply.Remove(apply);
            db.SaveChanges();

            return(Ok(apply));
        }
コード例 #6
0
ファイル: ccCreateGroup.cs プロジェクト: netgrind/GGJ2016
 //function should takea gameObject and an index
 public void applyToAll(apply func)
 {
     for(int i =0;i< all.Count;i++){
         func(all[i] as GameObject,i);
     }
 }
コード例 #7
0
 public Function(apply cb) : base(_name)
 {
     this.cb = cb;
 }