Пример #1
0
        public IAsyncEnumerator <T> ExecuteAsyncEnumerator <T>(ITableConfig table, IDatabaseQuery query, DatabaseParameterHandler parameters, ITransactionSource transaction = null)
        {
            var reader     = this.ExecuteReader(query, parameters, transaction);
            var mapper     = new EntityMapper(table);
            var visitor    = new EntityCompoundEnumeratorVisitor();
            var enumerable = new EntityCompoundEnumerator(this, table, mapper, visitor);
            var buffer     = new EntityEnumeratorBuffer(this);
            var sink       = new EntityEnumeratorSink(table);

            return(enumerable.AsEnumerableAsync <T>(buffer, sink, reader, true));
        }
Пример #2
0
 public IEnumerable <T> ExecuteEnumerator <T>(ITableConfig table, IDatabaseQuery query, DatabaseParameterHandler parameters, ITransactionSource transaction = null)
 {
     using (var reader = this.ExecuteReader(query, parameters, transaction))
     {
         var mapper     = new EntityMapper(table);
         var visitor    = new EntityCompoundEnumeratorVisitor();
         var enumerable = new EntityCompoundEnumerator(this, table, mapper, visitor);
         var buffer     = new EntityEnumeratorBuffer(this);
         var sink       = new EntityEnumeratorSink(table);
         foreach (var element in enumerable.AsEnumerable <T>(buffer, sink, reader))
         {
             yield return(element);
         }
     }
 }