コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            GitTesting gitTesting = db.GitTestings.Find(id);

            db.GitTestings.Remove(gitTesting);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID,GitName,GitAge")] GitTesting gitTesting)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gitTesting).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(gitTesting));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "ID,GitName,GitAge")] GitTesting gitTesting)
        {
            if (ModelState.IsValid)
            {
                db.GitTestings.Add(gitTesting);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gitTesting));
        }
コード例 #4
0
        // GET: GitTesting/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GitTesting gitTesting = db.GitTestings.Find(id);

            if (gitTesting == null)
            {
                return(HttpNotFound());
            }
            return(View(gitTesting));
        }