Esempio n. 1
0
        public IEnumerable <ExpandoObject> ResultDyn()
        {
            var cycle  = numerator;
            var helper = new DbMapperDyn(reader);

            do
            {
                object[] rec = numerator.Current; // as DbDataRecord;
                if (rec == null)
                {
                    yield break;    // first error
                }
                dynamic obj = helper.Get(rec);
                yield return(obj);
            } while (cycle.MoveNext());
        }
Esempio n. 2
0
        public IEnumerator <ExpandoObject> GetEnumerator()
        {
            Reset();
            DbEnumeratorData numerator = Numerator;

            if (numerator == null || numerator.Reader == null || !numerator.MoveNext())
            {
                yield break;
            }

            do
            {
                var rec = numerator.Current as object[]; // IDataRecord;
                if (rec == null || rec.Length == 0)
                {
                    yield break;    // first error
                }
                dynamic obj = helper.Get(rec);
                if (obj != null)
                {
                    yield return(obj);
                }
            }while (numerator.MoveNext());
        }