public async Task <IActionResult> Edit(int id, Testimonial testimonial) { if (id != testimonial.TestimonialId) { return(NotFound()); } if (ModelState.IsValid) { try { bool result = await _repo.Update(testimonial); if (result) { return(RedirectToAction("Index")); } return(View("Edit", new { id })); } catch { } } return(RedirectToAction("Error", "Home")); }
public ResponseModel Update(Testimonial testimonial) { return(_testimonialRepository.Update(testimonial)); }