コード例 #1
0
 public ActionResult Edit(Question question)
 {
     if (ModelState.IsValid)
     {
         _questionDbContext.Entry(question).State = EntityState.Modified;
         _questionDbContext.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(question));
 }
コード例 #2
0
        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));
        }