- Timestamp:
- 08/29/24 20:27:21 (3 months ago)
- Branches:
- main
- Children:
- 99d0ecc
- Parents:
- a850333
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PostgreSqlDotnetCore/Controllers/BlogPostAnswersController.cs
ra850333 re90ba32 155 155 public ActionResult Edit([Bind(include: "id,parent_id,reply,root_post,usersID")] BlogPostAnswers answerClass) 156 156 { 157 if (ModelState.IsValid) 158 { 159 db.Entry(answerClass).State = EntityState.Modified; 157 158 BlogPostAnswers answerClassDB = db.BlogPostAnswersObj.Find(answerClass.id); 159 if (answerClassDB != null && !answerClassDB.reply.Equals(answerClass.reply)) 160 { 161 answerClassDB.reply = answerClass.reply; 162 answerClassDB.parent_id = answerClass.parent_id; 163 db.Entry(answerClassDB).State = EntityState.Modified; 160 164 db.SaveChanges(); 161 return RedirectToAction("Index"); 162 } 163 return View(answerClass); 165 //return RedirectToAction("Index"); 166 int id = answerClassDB.BlogPostConsultationid; 167 return RedirectToAction("Details", "Blog", new { id }); 168 } 169 return View(answerClassDB); 164 170 } 165 171
Note:
See TracChangeset
for help on using the changeset viewer.