Beispiel #1
0
 public async Task <DocumentMetadata[]> GetMetadataAsync <T>(DocumentQuery query, CancellationToken cancellationToken)
 {
     using (IDocumentDatabaseProviderConnection connection = await _provider.OpenConnectionAsync(cancellationToken))
     {
         return(await connection.QueryMetadataAsync(_mapper.GetDocumentType <T>(), query, cancellationToken));
     }
 }
Beispiel #2
0
        public async Task <T[]> GetAsync <T>(DocumentQuery query, CancellationToken cancellationToken)
        {
            using (IDocumentDatabaseProviderConnection connection = await _provider.OpenConnectionAsync(cancellationToken))
            {
                DocumentRow[] rows = await connection.QueryAsync(_mapper.GetDocumentType <T>(), query, cancellationToken);

                return(rows.Select(r => _mapper.RowToDocument <T>(r)).ToArray());
            }
        }