如何从 StyleCop 规则 SA1600 中排除私人成员
有谁知道如何更改 StyleCop 规则 SA1600,该规则规定必须记录元素,以便它仅适用于属性而不适用于私有成员?
我们的 ORM (DevExpress XPO) 要求您拥有所有公共属性的私有成员(因为您必须在 setter 中调用函数来持久化它并将其存储在私有成员中),并注释公共属性和私有属性考虑到某些表有超过 50 个字段,具有相同内容的成员简直要了我的命。
Does anyone know how to change the StyleCop rule SA1600 that says elements must be documented so that it only applies to properties and not to private members?
Our ORM (DevExpress XPO) requires that you have private members for all public properties (because you have to call a function in the setter to persist it as well as storing it in the private member), and commenting both the public property and the private member with the same thing is killing me considering that some of the tables have upwards of 50 fields.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
右键单击 Visual Studio 中的项目节点,选择 StyleCop 设置。 在“规则”选项卡上,选择“文档规则”节点。 在右侧窗格中,选择“忽略私人”复选框,和/或取消选择“包括字段”框。 其中任何一个都会达到预期的效果。
Right click on your project node in Visual Studio, select StyleCop Settings. On the Rules tab, select the Documentation Rules node. In the right-hand pane, select the Ignore privates checkbox, and\or unselect the Include fields box. Either of these will achieve the desired effect.