public ActionResult Edit(Question question) { if (ModelState.IsValid) { _questionDbContext.Entry(question).State = EntityState.Modified; _questionDbContext.SaveChanges(); return(RedirectToAction("Index")); } return(View(question)); }
public async Task <ActionResult> Edit([Bind(Include = "CommentId,CommentTxt,CommentBy,CommentDt,CommentStatus,CommentStatusBy,CommentMarksEarned,CommentEdits,CommentType,postType,AnswerId")] AnswerComment answerComment) { if (ModelState.IsValid) { db.Entry(answerComment).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(answerComment)); }