我试图将一些数据推入到DynamoDB表中,而且我很难让.NET SDK检测到我想要列表或映射类型,而不是编号/字符串集类型。
var doc = new Document();
doc["Game ID"] = "SW Proto";
doc["Run ID"] = 666;
doc["Profiler Column"] = stats.Key.ToString();
//doc["Stats Data"] = stats.Value as List<string>;
// Works:
doc["Stats Data"] = new List<string> { "2.45", "2.35", "2.5" };
// Fails:
doc["Stats Data"] = new List<string> { "2.45", "2.45", "2.45" };它失败了,因为数据是非唯一的,这是集合类型所需要的.
如何强制将数据序列化为List或Map?
发布于 2015-09-16 23:00:28
要存储列表(L)而不是字符串集(SS),需要使用不同的转换模式。这篇博客文章讨论了不同的转换模式以及如何使用它们。
https://stackoverflow.com/questions/32481711
复制相似问题