public ActionResult DeleteConfirmed(int id)
        {
            ContactFormModel contactForm = _contactRepository.GetWhere(x => x.Id == id).FirstOrDefault();

            _contactRepository.Delete(contactForm);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        // GET: ContactForms/Delete/5
        public ActionResult Delete(int id)
        {
            // TODO: Add delete logic here
            var ContactForm = _repo.FindById(id);

            if (ContactForm == null)
            {
                return(NotFound());
            }

            var isSuccess = _repo.Delete(ContactForm);

            if (!isSuccess)
            {
                return(BadRequest());
            }
            return(RedirectToAction(nameof(Index)));
        }
Exemplo n.º 3
0
 public void Delete(int Id)
 {
     _repo.Delete(Id);
 }