Esempio n. 1
0
        private async Task <GetInvoicesDbQueryResult> ExecuteReaderAsync(ExecuteReaderRequest request)
        {
            GetInvoicesDbQueryResult result = null;
            var connection = (DbConnection)_connection;
            var executor   = connection.CreateCommandAsyncExecutor();
            await executor.ExecuteReaderAsync(request, async dataReader =>
            {
                var invoices = (await dataReader.ReadResultAsync(128, ReadInvoice, request.CancellationToken));
                result       = new GetInvoicesDbQueryResult(invoices);
            });

            return(result);
        }
Esempio n. 2
0
        private GetInvoicesDbQueryResult ExecuteReader(ExecuteReaderRequest request)
        {
            GetInvoicesDbQueryResult result = null;
            var executor = _connection.CreateCommandExecutor();

            executor.ExecuteReader(request, dataReader =>
            {
                var invoices = dataReader.ReadResult(128, ReadInvoice);
                result       = new GetInvoicesDbQueryResult(invoices);
            });

            return(result);
        }