Resharper - 私人与支持领域
有没有办法告诉 R# 对属性支持字段 (_camelCase) 和类实例字段 (camelCase) 应用不同的命名策略?
原因:我希望我的依赖项被命名为任何其他变量。特别是当字段类型与字段名称相同时。例如
private readonly MetaService metaService;
Is there a way to tell R# to apply different naming strategy for property backing fields (_camelCase) vs class instance fields (camelCase)?
Reason: I want my dependencies to be named just a any other variable. Especially if the type of the field is the same as the field name. For example
private readonly MetaService metaService;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,我不知道有什么方法可以做到这一点。
坦白说,我不明白其中的区别。
No, I don't know of a way to do this.
Frankly, I don't understand the distinction.
属性支持字段的命名约定应与类实例字段的命名约定相同。两者之间的唯一区别是可以从外部操作或访问。
如果您觉得需要进行区分,请添加评论。
The naming convention for a property backing field should be the same as that for a class instance field. The only difference between the two is that one can be manipulated or accessed from the outside.
If you feel the need to make a distinction, add a comment.