Book Image

DynamoDB Cookbook

By : Tanmay Deshpande
Book Image

DynamoDB Cookbook

By: Tanmay Deshpande

Overview of this book

Table of Contents (18 chapters)
DynamoDB Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Listing tables using the AWS SDK for .Net


Now, let's understand how to list all the DynamoDB tables using the AWS SDK for .Net.

Getting ready

You can use the IDE of your choice to code these recipes.

How to do it…

In this recipe, we will learn how to list the tables that we created earlier using the AWS SDK for .Net:

  1. Create an instance of the DynamoDB client and invoke the listTables method to get all the tables that you created earlier:

    AmazonDynamoDBClient client = new AmazonDynamoDBClient();
    var response = client.ListTables();
    ListTablesResult result = response.ListTablesResult;
  2. Iterate over the results variable to get the names of all the tables:

    foreach (string name in result.TableNames)
    Console.WriteLine(name);
  3. The AWS SDK for .Net also supports pagination for the list table request. If you want the list of tables to arrive in a paginated manner, then you may think of exploring it.

How it works…

The List table API internally calls DynamoDB services to fetch the details of the tables you have...