Remove Unused Member
Purpose
Used to remove a private class member (field, property, method, event, etc.), which is never used.
Availability
Available when the cursor is on the member name, providing this member is never assigned or referenced.
Usage
Place the caret on an unused member name.
NOTE
The blinking cursor shows the caret's position at which the Refactoring is available.
- Use the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions Menu.
- Select Remove Unused Member from the menu.
After execution, the Refactoring removes the member.
public class Person {
public string FirstName { get; set; }
public string LastName { get; set; }
}
See Also