public IActionResult Edit(int id, FaqVM model) { if (id != model.Faq.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _repository.UpdateFAQ(model.Faq); } catch (DbUpdateConcurrencyException) { if (!_repository.FAQExists(model.Faq.Id)) { return(NotFound()); } else { throw; } } model.ShowSuccessToast = true; return(View(model)); } return(View(model)); }