public ActionResult Delete(int id, ItemSubValorViewModel itemSubValorViewModel) { try { var itemSubValor = _gerenciadorDeItemSubValor.BuscarPorId(id); _gerenciadorDeItemSubValor.Excluir(itemSubValor); return(RedirectToAction("Index")); } catch { return(View()); } }
// POST: Delete public HttpResponseMessage Delete(int id) { HttpResponseMessage response; try { var itemSubValor = _gerenciadorDeItemSubValor.BuscarPorId(id); _gerenciadorDeItemSubValor.Excluir(itemSubValor); response = Request.CreateResponse(HttpStatusCode.OK, itemSubValor); } catch (Exception ex) { response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex); } return(response); }
public void Excluir() { _itemSubValorServiceMock.Setup(x => x.Delete(It.IsAny <ItemSubValor>())); _itemSubValorServiceMock.Setup(x => x.Save()); _gerenciadorDeItemSubValor.Excluir(ItemSubValorStub.ItemSubValor()); }