0

我有一个 Id 属性标记为的模型HashKey

[Alias("MyTable")]
public class MyModel
{
    [HashKey]
    public long Id { get; set; }

    public long EventId { get; set; }

    public MyModel(long id, long eventId)
    {
        Id = id;
        EventId = eventId;
    }
}

然后当我尝试添加新条目时:

await poco.PutItemAsync<MyModel>(new MyModel(123, 456));
await poco.PutItemAsync<MyModel>(new MyModel(777, 456));

新条目在 DynamoDB 中具有以下属性:

{ "Id": 0, "EventId": 456 }

每当我尝试再次输入其他条目时,它只会更新 ID = 0 的条目。

Seq表是空的。

我想要的是手动传递 Id 值(因为它来自外部系统并且保证是唯一的)并且不使用自动增量功能。

4

0 回答 0