Ormlite dynamic results, nullable and PrintDump

Currently I’m using ormlite with Oracle.

Typed result sets work great, but as soon as I use a custom select returning to a dynamic object there are issues accessing properties which are defined as number(*) or those which I would like to convert to nullable type.

For example, if I call PrintDump on a custom query that returned to a dynamic object, I will see

  BOX_1099:
                {
                        __type: "ServiceStack.OrmLite.Oracle.OracleValue, ServiceStack.OrmLite.Oracle"
                },

instead of the value. Similarly, if I wanted to set a nullable variable to that value it will throw an exception that it can’t convert. Yet, if it was a typed object, the query will convert to the nullable type without issue.

Additionally, if I call ToCsv() on that dynamic, the values are converted correctly.

What I’m in need of doing is displaying the select results to the console, which is what I wanted to use PrintDump since it formats things nice.

PrintDump() should only be used on serializable objects, it doesn’t work well on objects with Circular References and tries only tries to perform shallow “Safe Walk” on non circular reference properties which I’m assuming may be the issue, although I don’t have access to an Oracle instance to be able to verify.

I’d say you’d need to create your own extension method which manually traverses an OracleValue into a List or Dictionary then try dump that instead with something like: value.AsSerializable().PrintDump()

Yeah, it’s not circular if I use the function defined in the servicestack code. I’ll keep poking.