Exemplo n.º 1
0
        internal static async Task <List <T> > ReadTransactionAsList <T>(this IAsyncTransaction tx, string query, object parameters, Func <IResultCursor, T> conversionFunction)
        {
            var cursor = await tx.RunAsync(query, parameters);

            var fetched = await cursor.FetchAsync();

            var output = new List <T>();

            while (fetched)
            {
                output.Add(conversionFunction(cursor));
                fetched = await cursor.FetchAsync();
            }

            return(output);
        }
Exemplo n.º 2
0
 public IRxStatementResult Run(Statement statement)
 {
     return(new InternalRxStatementResult(Observable.FromAsync(() => _transaction.RunAsync(statement))
                                          .Cast <IInternalStatementResultCursor>()));
 }