Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
None
Description
Hi there.
I faced and exception today and don't quite know how to work around it. Couldn't find anything similar online aswell.
So, I consume a webservice, and it returns me an xml that I convert to a json and later on save it to a Mongo database. I'm saving it as BsonDocument, once I don't know every property on the json to map a working C# model (I can't ensure that the property will always be the same).
Later on the code, I retrive that information to a previously maped model class and I add the "BsonIgnoreExtraElements" annotation to it. Inside that class, I've got a List<> property, but in my json the equivalent of that property, it's a single object, not an array.
Is there anyway that I force that value to always be serialized as an array? Even if on the mongo database it was saved as a single.
Thanks !