Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying ReSharper Essentials
  • Table Of Contents Toc
  • Feedback & Rating feedback
ReSharper Essentials

ReSharper Essentials

By : Lukasz Gasior
4.3 (9)
close
close
ReSharper Essentials

ReSharper Essentials

4.3 (9)
By: Lukasz Gasior

Overview of this book

Table of Contents (18 chapters)
close
close
ReSharper Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Index

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

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
ReSharper Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon