Exemplo n.º 1
0
 public IActionResult Edit(TestimonialVieModel abs)
 {
     if (ModelState.IsValid)
     {
         Testimonial model = _mapper.Map <TestimonialVieModel, Testimonial>(abs);
         model.ModifiedBy = _admin.FullName;
         Testimonial TestToUpdate = _testimonialRepository.GetTestimonialById(abs.Id);
         if (TestToUpdate == null)
         {
             return(NotFound());
         }
         _testimonialRepository.UpdateTestimonial(TestToUpdate, model);
         return(RedirectToAction("index"));
     }
     return(View(abs));
 }