08_Querying.cs - AWS Code Sample

08_Querying.cs

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX - License - Identifier: Apache - 2.0 using System; using System.Threading.Tasks; using Amazon.DynamoDBv2.Model; using Amazon.DynamoDBv2.DocumentModel; using System.Collections.Generic; namespace DynamoDB_intro { public static partial class DdbIntro { public static async Task<List<List<Document>>> SearchListing_async(Search search) { List<List<Document>> docsList = new List<List<Document>>(); do { try { var getNextBatch = search.GetNextSetAsync(); var docList = await getNextBatch; docsList.Add(docList); } catch (Exception) { return null; } } while (!search.IsDone); return docsList; } public static async Task<QueryResponse> ClientQuerying_async(QueryRequest qRequest) { var response = await Client.QueryAsync(qRequest); return response; } }

Sample Details

Service: dynamodb

Last tested:

Author: AWS

Type: full-example