ProtoBuf-net serializing IEnumerable

前端 未结 2 1074
轻奢々
轻奢々 2020-12-19 03:40

I\'m trying to use ProtoBuf-NET in my project (it\'s mostly Silverlight 4 project).

I\'m having difficulties serializing my Model collections, they all are defined l

2条回答
  •  猫巷女王i
    2020-12-19 04:29

    I was trying to cut corners, and to reuse my model as a message contract, but this is actually wrong aproach. The way to go is to create DTO's specialized classes and converter to you model, anyway it's good to separate your model from messages.

    I must criticize Marc though, for adding ProtoContract and ProtoMemeber attributes that lure users to reuse their model by attributing it.

提交回复
热议问题