public ActionResult DeleteConfirmed(int id)
        {
            PostHashtag posthashtag = db.PostHashtag.Find(id);

            db.PostHashtag.Remove(posthashtag);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,PostID,HashtagID")] PostHashtag posthashtag)
 {
     if (ModelState.IsValid)
     {
         db.Entry(posthashtag).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HashtagID = new SelectList(db.Hashtag, "ID", "texto", posthashtag.HashtagID);
     ViewBag.PostID    = new SelectList(db.Post, "ID", "Texto", posthashtag.PostID);
     return(View(posthashtag));
 }
        // GET: /PostHashtag/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PostHashtag posthashtag = db.PostHashtag.Find(id);

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

            if (posthashtag == null)
            {
                return(HttpNotFound());
            }
            ViewBag.HashtagID = new SelectList(db.Hashtag, "ID", "texto", posthashtag.HashtagID);
            ViewBag.PostID    = new SelectList(db.Post, "ID", "Texto", posthashtag.PostID);
            return(View(posthashtag));
        }