Ejemplo n.º 1
0
        internal async Task <IList <WriteResult> > CommitAsync(ByteString transactionId, CancellationToken cancellationToken)
        {
            var request = new CommitRequest {
                Database = _db.RootPath, Writes = { Writes }, Transaction = transactionId
            };
            var response = await _db.Client.CommitAsync(request, CallSettings.FromCancellationToken(cancellationToken)).ConfigureAwait(false);

            return(response.WriteResults
                   .Select(wr => WriteResult.FromProto(wr, response.CommitTime))
                   .ToList());
        }
Ejemplo n.º 2
0
        internal async Task <IList <WriteResult> > CommitAsync(ByteString transactionId, CancellationToken cancellationToken)
        {
            var request = new CommitRequest {
                Database = _db.RootPath, Writes = { Elements.Select(e => e.Write) }, Transaction = transactionId
            };
            var response = await _db.Client.CommitAsync(request, CallSettings.FromCancellationToken(cancellationToken)).ConfigureAwait(false);

            return(response.WriteResults
                   // Only include write results from appropriate elements
                   .Where((wr, index) => Elements[index].IncludeInWriteResults)
                   .Select(wr => WriteResult.FromProto(wr, response.CommitTime))
                   .ToList());
        }