public virtual void Put(EDominio Entidade) { try { service.Editar(Entidade); } catch (Exception ex) { Erro _erro = new GerenciadorErroService().TrataErro(ex); throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, _erro.Mensagem)); } }
public virtual IEnumerable <EDominio> Get() { try { return(service.BuscarTodos()); } catch (Exception ex) { Erro _erro = new GerenciadorErroService().TrataErro(ex); throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, _erro.Mensagem)); } }
public virtual EDominio Get(int id) { try { return(service.BuscarPorId(id)); } catch (Exception ex) { Erro _erro = new GerenciadorErroService().TrataErro(ex); throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, _erro.Mensagem)); } }
public virtual void Delete(int id) { try { service.Excluir(id); } catch (Exception ex) { Erro _erro = new GerenciadorErroService().TrataErro(ex); throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, _erro.Mensagem)); } }