简体   繁体   English

为什么要密封Json.Net中的属性类?

[英]Why are attribute classes in Json.Net sealed?

Is there any spesific reason why eg Newtonsoft.Json.JsonIgnoreAttribute is a sealed class? 有什么特别的原因导致例如Newtonsoft.Json.JsonIgnoreAttribute是密封类? The reason I ask is because I'd like to make wrapper around the Json.Net calls, so that the assembly ref is in one assembly only (makes updating the assembly and testing a bit easier). 我问的原因是因为我想对Json.Net调用进行包装,所以程序集引用仅在一个程序集中(使程序集的更新和测试更加容易)。

因为通常这意味着它们没有任何目的(或服务)被扩展/专门化(就像.NET BCL中存在的许多属性类型一样)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM