public List<Pais> GetAllPais() { List<Pais> entidades = new List<Pais>(); var comando = BaseDatos.GetStoredProcCommand("SelectAllPais"); try { using (var lector = BaseDatos.ExecuteReader(comando)) { while (lector.Read()) { var entidad = new Pais(); entidad.IDPais = lector.IsDBNull(lector.GetOrdinal("IDPais")) ? default(int) : lector.GetInt32(lector.GetOrdinal("IDPais")); entidad.PAI_Nombre = lector.IsDBNull(lector.GetOrdinal("PAI_Nombre")) ? default(string) : lector.GetString(lector.GetOrdinal("PAI_Nombre")); entidades.Add(entidad); } lector.Close(); } } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } comando.Dispose(); return entidades; }
public int Update(Pais entity) { throw new NotImplementedException(); }