protobuf.net & conditional serialization

前端 未结 1 894
星月不相逢
星月不相逢 2021-01-25 03:09

We are using protobuf.net to serialize classes between mobile devices and back end services, but we now need to adjust what is sent back to the client based upon the \'context\'

相关标签:
1条回答
  • 2021-01-25 03:22

    It is a good question. The patterns currently supported (ShouldSerialize* etc) are borrowed "as is" entirely from the BCL, hence no context - however there is no reason it can't support parameters in the same way that the callbacks do - indeed, for callbacks it supports pretty much any usage (with/without context etc) - so I can't think of a good reason not to support them here to.

    You are right t say it isn't supported currently, but it could be - let me know of this would be useful.

    0 讨论(0)
提交回复
热议问题