user1003132
user1003132

Reputation: 105

ArangoDb .Net driver doesn't handle enum

I am a newbie for ArangoDB and I am trying to make some CRUD operation but I am stucked whenever getting to entity object with Enum.

It prompted me the message like this.

System.InvalidCastException : 
Invalid cast from 'System.Int64' to 'Testing.Sample.Repository.EventAction'.

EventAction is actually an Enum type. Once I switch it to integer and it works. I am wondering can I use enum for my case as it is more convenience to handle than using integer. Thanks.

Upvotes: 1

Views: 210

Answers (1)

yojimbo87
yojimbo87

Reputation: 68335

Since Enum type is not standard JSON type, driver serialize it as integer value. Deserialization might not be supported in the driver version you are using, however new version is going to be released soon with support for Enum type deserialization in strongly typed objects.

Upvotes: 3

Related Questions