dynamodb的新用户,并尝试将其与my集成。净核心。
我在以下方面使用了该示例:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LowLevelDotNetItemsExample.html
以下是示例:
private static string tableName = "ProductCatalog";
private static AmazonDynamoDBClient client = new AmazonDynamoDBClient();
private static void CreateItem()
{
var request = new PutItemRequest
{
TableName = tableName,
Item = new Dictionary<string, AttributeValue>()
{
{ "Id", new AttributeValue {
N = "1000"
}},
{ "Title", new AttributeValue {
S = "Book 201 Title"
}},
{ "ISBN", new AttributeValue {
S = "11-11-11-11"
}},
{ "Authors", new AttributeValue {
SS = new List<string>{"Author1", "Author2" }
}},
{ "Price", new AttributeValue {
N = "20.00"
}},
{ "Dimensions", new AttributeValue {
S = "8.5x11.0x.75"
}},
{ "InPublication", new AttributeValue {
BOOL = false
} }
}
};
client.PutItem(request);
}
但当我运行代码时,我会发现错误:
Error CS0122 'AmazonDynamoDBClient.PutItem(PutItemRequest)' is inaccessible due to its protection level
Error CS0122 'AmazonDynamoDBClient.GetItem(GetItemRequest)' is inaccessible due to its protection level
and so on for all the request.
这里缺少什么?
谢谢