Extract local function refactoring
This refactoring applies to:
- C#
What: Lets you turn a fragment of code from an existing method into a local function.
When: You have a fragment of existing code in some method that needs to be called from a local function.
Why: You could copy/paste that code, but that would lead to duplication. A better solution is to refactor that fragment into its own local function.
How-to
Highlight the code to be extracted.
Press Ctrl+. to trigger the Quick Actions and Refactorings menu.
Select Extract local function.
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for