【发布时间】:2010-10-31 03:58:24
【问题描述】:
在ProtoBuf-Net 实现中,ProtoInclude 属性是什么意思,它有什么作用?
一个例子将不胜感激。
我看到它in this post,但我不确定它的作用。例如:
[Serializable,
ProtoContract,
ProtoInclude(50, typeof(BeginRequest))]
abstract internal class BaseMessage
{
[ProtoMember(1)]
abstract public UInt16 messageType { get; }
}
[Serializable,
ProtoContract]
internal class BeginRequest : BaseMessage
{
[ProtoMember(1)]
public override UInt16 messageType
{
get { return 1; }
}
}
另外,有没有办法使用 protogen 工具生成这样的继承?
【问题讨论】:
-
重新缺少评论;我明白了:看这里:meta.stackexchange.com/questions/27677/…
标签: c# .net protocol-buffers protobuf-net