public IEnumerable <T> Query <T>(DatabaseProxyCommand cmd, TableMapping mapping)
        {
            if (mapping.NameForPath.Count == 0)
            {
                foreach (var e in Query <T>(cmd))
                {
                    yield return(e);
                }
                yield break;
            }
            System.Diagnostics.Debug.WriteLine("Executing SQL:" + cmd.CommandText + "\r\n\r\n\r\n");

            var reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                T      obj = CreateObject <T>();
                object j   = obj;
                SetValues(reader, mapping, ref j, typeof(T));
                obj = ( T )j;
                yield return(obj);
            }
            reader.Close();

            yield break;
        }
        public IEnumerable <T> Query <T>(DatabaseProxyCommand cmd)
        {
            System.Diagnostics.Debug.WriteLine("Executing SQL:" + cmd.CommandText + "\r\n\r\n\r\n");

            var reader = cmd.ExecuteReader();

            Dictionary <string, int> columns = new Dictionary <string, int>(StringComparer.InvariantCultureIgnoreCase);

            for (var i = 0; i < reader.FieldCount; i++)
            {
                columns[reader.GetName(i)] = i;
            }

            while (reader.Read())
            {
                T      obj = CreateObject <T>();
                object j   = obj;
                SetValues(reader, columns, ref j, typeof(T));
                obj = ( T )j;
                yield return(obj);
            }
            reader.Close();

            yield break;
        }
        public IEnumerable <object[]> Query(DatabaseProxyCommand cmd)
        {
            System.Diagnostics.Debug.WriteLine("Executing SQL:" + cmd.CommandText + "\r\n\r\n\r\n");

            var reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                object[] obj = new object[reader.FieldCount];
                reader.GetValues(obj);
                yield return(obj);
            }
            reader.Close();

            yield break;
        }