I have two classes:

        public class TestClass: Base<TestClass>
                [DataMember(Order = 1)]
                public string Str { get; set; }

        public class Base<T>
                public T ReturnType { get; set; }

I know, that I must use ProtoInclude attribute to allow serialization.

Problem is, that I have about 100 classes that inherit from Base
class, and I should write 100 attributes.
Is any possibility to add this information not using Attribute on
class but programmatically?

In DataContractSerializerOperationBehavior when you override method
CreateSerializer you may write code to add your own list of known

But.. ProtoInclude has not only information about type but also tag.

can anyone help?

Bartosz Pierzchlewicz


You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to