public HttpResponseMessage Excluir(Guid id) { try { _contatoAppService.Excluir(id); return(Request.CreateResponse(HttpStatusCode.OK)); } catch { return(Request.CreateResponse(HttpStatusCode.InternalServerError)); } }
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)); } }
public IActionResult Excluir(Guid id) { _contatoAppService.Excluir(id); return(Ok()); }
public ActionResult Excluir(string id, FormCollection form) { contatoApp.Excluir(id); return(RedirectToAction("Inicio")); }