如何从StyleCop规则SA1600中排除私人成员 [英] How to exclude private members from StyleCop rule SA1600

查看:63
本文介绍了如何从StyleCop规则SA1600中排除私人成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何更改StyleCop规则SA1600,该规则说元素必须记录在案,以便它仅适用于属性,而不适用于私有成员?

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?

我们的ORM(DevExpress XPO)要求您具有所有公共属性的私有成员(因为您必须在setter中调用一个函数以将其持久化以及将其存储在私有成员中),并对公共属性进行注释考虑到其中某些表的字段多达50个,因此拥有相同内容的私有成员正在杀死我.

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.

推荐答案

在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.

这篇关于如何从StyleCop规则SA1600中排除私人成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆