rpgmaker / NetJSON

Faster than Any Binary? Benchmark: http://theburningmonk.com/2014/08/json-serializers-benchmarks-updated-2/
MIT License
225 stars 29 forks source link

DataTable DataSet serialization #216

Closed frankiDotNet closed 5 years ago

frankiDotNet commented 5 years ago

Hello,

is there any way to serialize a DataSet or a DataTable? I have got an exception trying it.

rpgmaker commented 5 years ago

I have not tried yet. But if you can create a wrapper for it then it should be possible.

Thanks,

rpgmaker commented 5 years ago

Did you try what i said about creating a wrapper around it. I don't plan on supporting direct serialization and deserialization of datatable and dataset since it is a very complex object

frankiDotNet commented 5 years ago

Not yet.. I have come around with protobuf-net data. It was the simpler way for this time, even I didn't want to lose the complexebility of the dataset. If you don't plan to do it I will close for now. I also think this is a special point.

rpgmaker commented 5 years ago

The best thing I would say that would work for you is if you wait for the custom serialization layer I am working on. Then it can become a plug-in that someone or maybe I could write for it later.

A quick was to approach the solution is to have a collection of dictionary where is key is column and value is the column value in regards to data table. As for the dataset, it can be a collection of the custom wrapper on top of datatable which uses the key as name of DB and the value as a collection of the custom wrapper.

Thanks,

rpgmaker commented 5 years ago

Hey, I have implemented the solution to support custom types. So you can now write your custom serializer that will get called instead of the default one that does not work currently with datatable.

Information can be found here: https://github.com/rpgmaker/NetJSON/issues/215