Hi everybody! working with the C# driver, i have this issue, maybe you can help me to solve or improve my code
I have a basic entity "Entity" in c# that is a typed one, with properties etc. One of the properties, is called "Content" and allows you to store dynamic content on it. In the C# part, this property is of type IDictionary<string, object>
Doing this, i can store my basic entity, and in his content, any dynamic content that i want.
Problem: if in the content i have int values, are stored as "NumberLong" and that causes a Deserialization problem with .ToJson().
Example:
Content: { "value":1} is stored as {"value" : NumberLong(1)}, deserialization error "Error parsing NaN value. Path '[0].Content.value', line 1, position nnn."
C# Deserialization code:
JArray o = JArray.Parse(ret.ToArray().ToJson()); where ret is a collection of type Event.
How to solve this? Change the type of "Content" property to...? Build a custom serializer for this property? Avoid to numbers to be stored as "NumberLong" configuring something in the server/mapping for the property?
Any help will be appreciated
Thanks!!
Javi