I have an object that has custom data types in it. When I try to pass that object through my REST API, I get an error that says: The 'ObjectContent'1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.
I am assuming that the API is attempting to serialize my custom object (with custom data types) in order to convert it to JSON. Is there a way I can make this possible? I am coding in visual basic.
EDIT: I am using ASP.NET Framework 4.6.1
. My object is involved with connecting to a database. Because of that, I have created custom datatypes such as databasePointer
which is simply a long value. This is so I don't mix up numbers when connecting to the database. I simply need to find out how to convert those custom data types back to primitive data types before I pass my object to be serialized.