Remove Unused Member
Purpose
Used to remove a class member (field, property, method, event, etc.) that is never used.
Availability
Available when the cursor is on the member name (if 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.
- Press 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