示例#1
0
        public List <T> GetAll()
        {
            var           lista   = new List <T>();
            IDbConnection con     = conexion.GetConnection();
            IDbCommand    command = con.CreateCommand();

            command.CommandType = CommandType.Text;
            command.CommandText = $"SELECT * FROM {Tabla}";
            con.Open();
            IDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                lista.Add(Map(reader));
            }
            con.Close();
            return(lista);
        }