Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
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.