Using the AWS SDK for .net I'm trying to save a list of non-unique strings. This list isn't the primary hash or anything, I just want to be able to reference them by their order and include duplicates.
The model
[DynamoDBTable("RMS.Accounts")]
public class Account
{
[DynamoDBHashKey]
public int Id { get; set; }
public string SomeValue { get; set; }
public List<string> MoreValues{ get; set; }
public Account()
{
// set default value
MoreValues= new List<string>();
}
}
The controller
Account account = new Account();
account.SomeValue = "testvalue";
account.MoreValues.Add("value1");
account.MoreValues.Add("value1");
var client = new AmazonDynamoDBClient();
var context = new DynamoDBContext(client);
context.Save(account, new DynamoDBOperationConfig() { SkipVersionCheck = true });
When I run the above code I get:
"An exception of type 'Amazon.DynamoDBv2.AmazonDynamoDBException' occurred in Apfm.RMS.Common.dll but was not handled in user code
Additional information: One or more parameter values were invalid: Input collection [value1, value1] contains duplicates.
I've read everything I can get my hands on but can't figure out a way around this. Maybe I need to use some other kind of collection so Dynamo knows the items don't need to be unique.