private Table CreateTable()
{
try
{
Client.CreateTable(new CreateTableRequest
{
TableName = Configuration.TableName,
KeySchema = new List<KeySchemaElement>
{
new KeySchemaElement { AttributeName = defaultConfigs.HashKey, KeyType = "HASH" },
new KeySchemaElement { AttributeName = defaultConfigs.RangeKey, KeyType = "RANGE" }
},
AttributeDefinitions = new List<AttributeDefinition>
{
new AttributeDefinition { AttributeName = defaultConfigs.HashKey, AttributeType = "S" },
new AttributeDefinition { AttributeName = defaultConfigs.RangeKey, AttributeType = "S" }
},
ProvisionedThroughput = new ProvisionedThroughput { ReadCapacityUnits = Configuration.ReadUnits, WriteCapacityUnits = Configuration.WriteUnits }
});
}
catch (Exception e)
{
WriteEventLogMessage(string.Format("Error while creating table {0}: {1}", Configuration.TableName, e.ToString()), EventLogEntryType.Error);
return null;
}
Table table = Table.LoadTable(Client, Configuration.TableName);
return table;
}