I’m translating some code from the DataContractSerializer to the impressive protobuf-net serializer, and one thing that I’m really missing is the StreamingContext passed through to my OnDeserializing methods. I’d really like to find a way to pass a bit of context information through to some of my objects during their deserialization.
My question: is this usage pattern supported in protobuf-net? I haven’t found an equivalent so far in my investigation of its APIs, but I’m not very familiar with its design so may have overlooked something.
The signature with a
StreamingContextis supported, but it does not currently include the.Context(it currently just announcesStreamingContextStates.Persistencewith.Context = null), if that is what you mean.I could support that by adding an overload to the serialize/deserialize methods – presumably that would solve it?If so, please log a feature request on the project site. Since it already supports
StreamingContextin this scenario, it doesn’t sound hard.