public ActionResult DeleteConfirmed(int id)
        {
            CoursePlaylist coursePlaylist = db.CoursePlaylists.Find(id);

            db.CoursePlaylists.Remove(coursePlaylist);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "CoursePlaylistId,CourseId,PlaylistId,PlaylistName")] CoursePlaylist coursePlaylist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(coursePlaylist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseId = new SelectList(db.Courses, "Id", "Title", coursePlaylist.CourseId);
     return(View(coursePlaylist));
 }
        public ActionResult Create([Bind(Include = "CoursePlaylistId,CourseId,PlaylistId,PlaylistName")] CoursePlaylist coursePlaylist)
        {
            if (ModelState.IsValid)
            {
                db.CoursePlaylists.Add(coursePlaylist);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CourseId = new SelectList(db.Courses, "Id", "Title", coursePlaylist.CourseId);
            return(View(coursePlaylist));
        }
        // GET: YouTube/CoursePlaylists/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CoursePlaylist coursePlaylist = db.CoursePlaylists.Find(id);

            if (coursePlaylist == null)
            {
                return(HttpNotFound());
            }
            return(View(coursePlaylist));
        }
        // GET: YouTube/CoursePlaylists/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CoursePlaylist coursePlaylist = db.CoursePlaylists.Find(id);

            if (coursePlaylist == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CourseId = new SelectList(db.Courses, "Id", "Title", coursePlaylist.CourseId);
            return(View(coursePlaylist));
        }