Use “convert to auto property” on multiple properties at once

夙愿已清 提交于 2019-11-29 07:28:37

The ReSharper can do this:

Options -> Code Cleanup -> Use auto-property, if possible

Run code cleanup for the class - and you should be done.

Tanascius has the right answer, though you can tweak that a little bit by creating your own custom Code Cleanup script that would ONLY include the "Use auto-property if possible" refactoring.

That would probably be preferable if you didn't want the rest of the refactorings to run. Just hit the add button on the code cleanup and then uncheck everything else.

-Max

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