Protobuf-net and deriving from generic collections?

ProtoInclude is used to denote sub types, not base types (after all, the base-type is already known). Also, the IList.

ProtoInclude is used to denote sub types, not base types (after all, the base-type is already known). Also, the IList handling should largely be implicit; note that the "infer..." etc do very little in the case of lists, since lists are just a sequence of the contained items. For the following, I'm assuming that you are trying to serialize the list (as the top-most object): I'm not on the right machine at the moment, but in the released dlls, I would expect that wrapping the list via an object would make it work: DataContract public class Foo { private readonly UserTypeCollection items = new UserTypeCollection(); DataMember(Order=1) public UserTypeCollection Items {get{return items;}} } In "v2" I would hope that this scenario works from the outset.

I'll try to test this tomorrow (when I'll have the right machine). One other thought; subclassing List isn't usually very useful, since none of the methods are virtual. Up to you, of course.

And a final note - in "v2" we can describe the model externally if you want to have more control over the serialization but without impacting the types themselves.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions