Refactoring
You will seldom work with the ideal code. Almost every code can be improved—variables or methods can have better names, and code can be better structured and less complicated. This means that you would like to refactor such code. Refactoring code is a very hard and complicated process but ReSharper makes it a bit less painful.
Let's go back to our code that was used at the beginning of this chapter and refactor it a bit.
Rename
Let's say that we would like to rename the Repository
property to UserRepository
. Move your cursor to the definition or usage of this property and press Ctrl + R, R, input a new name, and press Enter. ReSharper will rename all occurrences of this property.
ReSharper also checks your string values, comments, JavaScript code, and other string literals as there can be some values related to our code that should also be updated. As you can see in the following screenshot, ReSharper displays all the places that can be potentially updated and allows you to check...