Пример #1
0
        public ActionResult Edit(ContactForm model)
        {
            try
            {
                // TODO: Add update logic here
                if (!ModelState.IsValid)
                {
                    return(View(model));
                }
                var ContactForm = _mapper.Map <ContactForm>(model);
                var isSuccess   = _repo.Update(ContactForm);
                if (!isSuccess)
                {
                    ModelState.AddModelError("", "Something Went Wrong!");
                    return(View(model));
                }

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                ModelState.AddModelError("", "Something Went Wrong!");
                return(View(model));
            }
        }
Пример #2
0
 public int Update(ContactForm contactForm)
 {
     return(_repo.Update(contactForm));
 }