Beispiel #1
0
        protected static IEnumerator <object> ExecuteCustomMapper <T> (Func <IDataReader, T> customMapper, Future <QueryDataReader> fReader)
        {
            yield return(fReader);

            using (var reader = fReader.Result) {
                using (var e = EnumeratorExtensionMethods.EnumerateViaThreadpool(
                           CustomMapperWrapper <T>(reader.Reader, customMapper),
                           TaskEnumerator <T> .DefaultBufferSize
                           ))
                    while (e.MoveNext())
                    {
                        var v = e.Current;

                        yield return(v);
                    }
            }
        }
Beispiel #2
0
        protected static IEnumerator <object> ExecuteMapper <T> (Future <QueryDataReader> fReader)
            where T : class, new()
        {
            yield return(fReader);

            using (var reader = fReader.Result) {
                var mapper = new Mapper.Mapper <T>(reader.Reader);

                using (var e = EnumeratorExtensionMethods.EnumerateViaThreadpool(
                           mapper.ReadSequence(), TaskEnumerator <T> .DefaultBufferSize
                           ))
                    while (e.MoveNext())
                    {
                        var v = e.Current;

                        yield return(v);
                    }
            }
        }