如何从 StyleCop 规则 SA1600 中排除私人成员

发布于 2024-07-22 05:56:44 字数 202 浏览 14 评论 0原文

有谁知道如何更改 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

您的好友蓝忘机已上羡 2024-07-29 05:56:44

右键单击 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文