public void ExecuteEnt() { int nIdentificacao; prms = InfoGetter(prms); try { nIdentificacao = Convert.ToInt32(prms[0]); } catch (FormatException) { Console.WriteLine("Alguns parametros estavam errados."); return; } using (var ctx = new GlampinhoEntities()) { try { ctx.DeleteHospede(nIdentificacao.ToString()); ctx.SaveChanges(); } catch (Exception e) { Console.WriteLine(e.InnerException.Message); return; } } Console.WriteLine("Hospede removido com sucesso!"); }