public ActionResult Edit(FAQViewModel model, string toDo = "") { if (toDo.ToLower() == "delete") { _faqRepository.Delete(model.Id); _faqRepository.Save(); return(RedirectToAction("Index")); } if (ModelState.IsValid) { var faq = _faqRepository.Find(model.Id); model.UserId = User.Identity.GetUserId(); faq.Update(model); _faqRepository.Update(faq); _faqRepository.Save(); return(RedirectToAction("Index")); } AddToViewBag(); return(View("Edit", model)); }
public void editFAQ(FAQ obj) { FAQRepository.Update(obj); SaveChange(); }
public int UpdateFAQ(DLModel.FAQ faq) { return(_faqRepository.Update((DLModel.FAQ) new DLModel.FAQ().InjectFrom(faq))); }