Remove Redundant Destructor (C#)
In This Article
Removes the destructor under the cursor, if it does not contain executable code.
#Availability
Available from the context menu or via shortcuts:
- when the cursor is on a destructor declaration, provided that the destructor does not contain executable code lines.
#Examples
class TestClass
{
private string _name;
public TestClass(string param)
{
_name = param;
}│~ TestClass()
{
}
}
Result:
class TestClass
{
private string _name;
public TestClass(string param)
{
_name = param;
}
│}