0-1. CreateTable cs - Amazon-DynamoDB

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

0-1. CreateTable cs

Das Programm 01-CreateTable.cs erstellt eine Tabelle (TryDaxTable). Der Rest. NETDie Programme in diesem Abschnitt hängen von dieser Tabelle ab.

using System; using System.Collections.Generic; using System.Threading.Tasks; using Amazon.DynamoDBv2; using Amazon.DynamoDBv2.Model; namespace ClientTest { class Program { public static async Task Main(string[] args) { AmazonDynamoDBClient client = new AmazonDynamoDBClient(); var tableName = "TryDaxTable"; var request = new CreateTableRequest() { TableName = tableName, KeySchema = new List<KeySchemaElement>() { new KeySchemaElement{ AttributeName = "pk",KeyType = "HASH"}, new KeySchemaElement{ AttributeName = "sk",KeyType = "RANGE"} }, AttributeDefinitions = new List<AttributeDefinition>() { new AttributeDefinition{ AttributeName = "pk",AttributeType = "N"}, new AttributeDefinition{ AttributeName = "sk",AttributeType = "N"} }, ProvisionedThroughput = new ProvisionedThroughput() { ReadCapacityUnits = 10, WriteCapacityUnits = 10 } }; var response = await client.CreateTableAsync(request); Console.WriteLine("Hit <enter> to continue..."); Console.ReadLine(); } } }