yojimbo87 / ArangoDB-NET

C#/.NET/Mono driver for ArangoDB
MIT License
107 stars 66 forks source link

Insert document fails whis property "array" #23

Closed secana closed 9 years ago

secana commented 9 years ago

Hi,

inserting a document with a property of type "System.Double[]" fails with a "System.MissingMethodException". I used "db.Document.CreateCollection(true).Create(collection, doc)" to insert the document. Is it not possible to handle arrays with the driver?

yojimbo87 commented 9 years ago

Hi,

serialization of arrays should work. Can you please also post the whole structure/schema of your document which you are trying to save?

secana commented 9 years ago

Hi again,

because you said that the driver can serialize arrays I took a deep look into the code and found the bug. I used the ArangoDB driver fork before your project and they had a "Document" class which was a wrapper around a Dictionary. To keep my code compatible I created a class "Document" which inherits from Dictionary and used it with your project. Now the error: When db.Document.CreateCollection(true).Create(collection, dic) gets a object which inherits from dictionary it uses "Clone" method internally which fails. When I use a Dictionary directly it works. So no issue on your side. Thx for the fast response!