Reputation: 23
I have the below class that I have decorated with DynamoDb attributes:
[DynamoDBTable("Orders")]
public class OrderDynamoModel
{
[DynamoDBHashKey]
public int OrderId { get; set; }
[DynamoDBProperty]
public DateTime DateTimeUtc { get; set; }
[DynamoDBProperty]
public int TId { get; set; }
[DynamoDBProperty]
public OrderStatus Status { get; set; }
[DynamoDBProperty]
public string Order { get; set; }
}
[Flags]
public enum OrderStatus
{
None = 0,
Pending = 1,
Completed = 2
}
When I try to save an instance of the class using DynamoDBContext.Save, I get the below error:
Type OrderStatus is unsupported, it cannot be instantiated
When I change the type of the property from OrderStatus to int and update the code accordingly, it can save the record in DynamoDb successfully.
Any idea why I can't use the enum?
Upvotes: 2
Views: 2625