Force protobuf-net to ignore IEnumerable/ICollection interfaces

故事扮演 提交于 2019-12-04 06:06:48
[ProtoContract(IgnoreListHandling = true)]
public class FileTree : ICollection<FilePath> ...
{ ... }

should do it. I honestly don't think I've considered callbacks on lists, since they are handled so very different to entities, but with the above that should work. Let me know if it doesn't.

From the intellisense documentation:

Gets or sets a value indicating that this type should NOT be treated as a list, even if it has familiar list-like characteristics (enumerable, add, etc)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!