How to exclude private members from StyleCop rule SA1600

纵然是瞬间 提交于 2019-12-20 16:16:22

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/912831/how-to-exclude-private-members-from-stylecop-rule-sa1600

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