public void Salvar(tb_uf _uf) { try { _DAO.Add(_uf); _DAO.SaveChanges(); } catch (Exception ex) { throw new Exception("Erro ao salvar uf." + ex.Message); } }
public void Deletar(tb_uf _uf) { try { _uf = _DAO.Find(uf => uf.cod_uf == _uf.cod_uf).First <tb_uf>(); _DAO.Delete(_uf); _DAO.SaveChanges(); } catch (Exception ex) { throw new Exception("Não possível excluir uf." + ex.Message); } }