I’m using CB Lite v2.8.6 on Xamarin and creating a mutable document and passing document Id and object of type Dictionary<string, object> if the object has some decimal value it is throwing the following error.
System.ArgumentException : Decimal is not a valid type. You may only pass byte, sbyte, short, ushort, int, uint, long, ulong, float, double, bool, DateTimeOffset, Blob,, Blob, a one-dimensional array or a dictionary whose members are one of the preceding types.
code: var doc = new MutableDocument(Id, valueProps);
It works if I convert the decimal values to a string or integer.
valueProps = new Dictionary<string, object>{ {"id": "abcd"}, {"abc": "12"}, {"xyz": {"type":"something","id":"jsf..93sd","issued":"2015-06-29","quantity":{"value":100.0,"unit":"lb",},}} }
^^^ This wouldn’t work as the “value” is 100.0 (decimal)
valueProps = new Dictionary<string, object>{ {"id": "abcd"}, {"abc": "12"}, {"xyz": {"type":"something","id":"jsf..93sd","issued":"2015-06-29","quantity":{"value":"100.0","unit":"lb",},}} }
^^^ This work as the “value” is “100.0” (string)
Can anyone help on. how I could fix this issue?