I need to create a method of class that delete the instance.
public class Car
{
private string m_Color;
public string Color
{
get { return m
What you're asking is not possible. There is no mechanism in .Net that would set all references to some object to null
.
And I think that the fact that you're trying to do this indicates some sort of design problem. You should probably think about the underlying problem and solve it in another way (the other answers here suggest some options).