public HttpResponseMessage Excluir(Guid id)
 {
     try
     {
         _contatoAppService.Excluir(id);
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     catch
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError));
     }
 }
Esempio n. 2
0
        public ActionResult Delete(ContatoModel contatoModel)
        {
            try
            {
                if (_contatoAppService.Excluir(contatoModel.ContatoId))
                {
                    return(RedirectToAction(nameof(Index)));
                }

                return(View(contatoModel));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("ContatoId", ex.Message);
                return(View(contatoModel));
            }
        }
Esempio n. 3
0
 public IActionResult Excluir(Guid id)
 {
     _contatoAppService.Excluir(id);
     return(Ok());
 }
Esempio n. 4
0
 public ActionResult Excluir(string id, FormCollection form)
 {
     contatoApp.Excluir(id);
     return(RedirectToAction("Inicio"));
 }