public ActionResult rateComment(int?id) { var userProfile = db.userProfiles.Find(User.Identity.GetUserId()); var comment = db.comments.Find(id); if (!userProfile.comments1.Contains(comment)) { userProfile.comments1.Add(comment); db.Entry(userProfile).State = EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("Details", "Home", new { id = comment.compId })); }
public ActionResult Edit([Bind(Include = "userId,userName,email")] userProfile userProfile) { if (ModelState.IsValid) { db.Entry(userProfile).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userProfile)); }
public ActionResult Edit([Bind(Include = "compId,userId,firstPlayerId,secondPlayerId,exp")] comp comp) { if (ModelState.IsValid) { db.Entry(comp).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.userId = new SelectList(db.userProfiles, "userId", "userName", comp.userId); return(View(comp)); }
public ActionResult Edit([Bind(Include = "scoreId,compId,userId,isFirstPlayerBetter")] score score) { if (ModelState.IsValid) { db.Entry(score).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.compId = new SelectList(db.comps, "compId", "userId", score.compId); ViewBag.userId = new SelectList(db.userProfiles, "userId", "userName", score.userId); return(View(score)); }