コード例 #1
0
        public ActionResult Create(YoutubeVideo youtubevideo)
        {
            if (ModelState.IsValid)
            {
                db.YoutubeVideos.Add(youtubevideo);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(youtubevideo);
        }
コード例 #2
0
 public ActionResult Edit(YoutubeVideo youtubevideo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(youtubevideo).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(youtubevideo);
 }