.NET and DynamoDB
In this tutorial, you use the AWS SDK for .NET to write simple programs to perform the following Amazon DynamoDB operations:
Create a table called
Moviesusing a utility program written in C# and load sample data in JSON format.
Perform create, read, update, and delete operations on the table.
Run simple queries.
The DynamoDB module of the AWS SDK for .NET offers several programming models for different use cases. In this exercise, the C# code uses both the document model, which provides a level of abstraction that is often convenient, and also the low-level API, which handles nested attributes more effectively. For information about the document model API, see .NET: Document Model, and for information about the low-level API, see Working with Tables Using the AWS SDK for .NET Low-Level API.
You use the downloadable version of DynamoDB in this tutorial. In the Summary, we explain how to run the same code against the DynamoDB service in the cloud.
Use a computer running a recent version of Microsoft Windows and a current version of Microsoft Visual Studio. If you don't already have Visual Studio installed, you can download a free copy of the Community edition from the Visual Studio website.
Download and run DynamoDB Local. For more information, see Running DynamoDB on Your Computer.
Sign up for Amazon Web Services and create access keys. You need these credentials to use AWS SDKs. To create an AWS account, go to https://aws.amazon.com/, choose Create an AWS Account, and then follow the online instructions.
Set up a security profile for DynamoDB in Visual Studio. See the step-by-step instructions for doing this in Creating Example Tables and Uploading Data Using the AWS SDK for .NET.
In Visual Studio, create a new project called
DynamoDB_introusing the Console Application template in the Installed/Templates/Visual C#/ node. This is the project you use throughout this Getting Started tutorial.
The following tutorial does not work with .NET core as it does not support synchronous methods. For more information, see AWS Asynchronous APIs for .NET.
Install the NuGet package for the DynamoDB module of the AWS SDK for .NET, version 3 into you new
DynamoDB_introproject. To do this, open the NuGet Package Manager Console from the Tools menu in Visual Studio and type the following command at the
PM> Install-Package AWSSDK.DynamoDBv2