Check out example codes for "c# trigger destructor". It will help you in understanding the concepts better.

Code Example 1

//You don't call the destructor in .NET The managed heap is handled by the CLR and the CLR only.

//You can however define a destructor to a class, the destructor would be called once the object gets collected by the GC

class Foo
    {
        public Foo()
        {
            Console.WriteLine("Constructed");
        }

        ~Foo()
        {
            Console.WriteLine("Destructed");
        }
    }
//Take notice that the destructor doesn't (and can't) have a public modifier in-front of it, it's sort of an hint that you can't explicitly call the destructor of an object.

Learn ReactJs, React Native from akashmittal.com