代码分析 Microsoft.Naming 对缩写“ID”的警告
我一直在所有属性名称和 sql 列名称中使用 ID(大写字母)。现在我已经开始纠正所有代码分析警告,以在团队中实施新的编码指南。
有没有办法将 ID 添加到不会生成警告的字典中(例如 CA1709 )?
例子 -
Warning 4 CA1709 : Microsoft.Naming : Correct the casing of 'ID' in member name 'City.CityID' by changing it to 'Id'.
'Id' is an abbreviation and therefore is not subject to acronym casing guideline.
I have been using ID (capital case) in all my property names and sql column names. Now i have started to correct all code analysis warnings to enforce new coding guidelines on the team.
Is there a way to add ID to a dictionary where it wont generate warnings (such as CA1709)?
Example -
Warning 4 CA1709 : Microsoft.Naming : Correct the casing of 'ID' in member name 'City.CityID' by changing it to 'Id'.
'Id' is an abbreviation and therefore is not subject to acronym casing guideline.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终将其添加到自定义词典中 - 并且它起作用了。谢谢 Alastair Pitts
,它还帮助我添加它抱怨的其他拼写 - 比如 facebook、twitter 等。
I ended up adding this in a custom dictionary - and it worked. Thanks Alastair Pitts
And it also helps me add other spellings which it complains about - like facebook, twitter etc.