-
StackOverflow 文档
-
amazon-dynamodb 教程
-
将 AWS DynamoDb 与 AWS .NET SDK 配合使用
-
低级 API 示例
var client = new AmazonDynamoDBClient();
// Store item
client.PutItem(new PutItemRequest
{
TableName = "Books",
Item = new Dictionary<string, AttributeValue>
{
{ "Title", new AttributeValue { S = "Cryptonomicon" } },
{ "Id", new AttributeValue { N = "42" } },
{ "Authors", new AttributeValue {
SS = new List<string> { "Neal Stephenson" } } },
{ "Price", new AttributeValue { N = "12.95" } }
}
});
// Get item
Dictionary<string, AttributeValue> book = client.GetItem(new GetItemRequest
{
TableName = "Books",
Key = new Dictionary<string, AttributeValue>
{
{ "Id", new AttributeValue { N = "42" } }
}
}).Item;
Console.WriteLine("Id = {0}", book["Id"].S);
Console.WriteLine("Title = {0}", book["Title"].S);
Console.WriteLine("Authors = {0}",
string.Join(", ", book["Authors"].SS));