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)); }
//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); } }
public IHttpActionResult Getapply(int id) { apply apply = db.apply.Find(id); if (apply == null) { return(NotFound()); } return(Ok(apply)); }
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)); }
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)); }
//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); } }
public Function(apply cb) : base(_name) { this.cb = cb; }