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 ...

Get ReSharper Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.