Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you serialize/deserialize jagged/nested arrays with protobuf-net?

In his answer to For which scenarios is protobuf-net not appropriate? Marc mentions:

jagged arrays / nested lists without intermediate types aren't OK - you can shim this by introducing an intermediate type in the middle

I'm hoping this suggests there is a way to do it without changing my underlying code, maybe using a surrogate? Has anybody found a good approach to serializing/deserializing a nested/jagged array

like image 250
David Hayes Avatar asked Dec 26 '22 05:12

David Hayes


1 Answers

At the current time, it would require (as the message suggests) changes to your model. However, in principal this is something that that the library could do entirely in its own imagination - that is simply code that I haven't written / tested yet. So it depends how soon you need it... I can take a look at it, but I can't guarantee any particular timescale.

like image 138
Marc Gravell Avatar answered Feb 13 '23 21:02

Marc Gravell