xxxxxxxxxx
The Dispose method. This method comes from the IDisposable
interface and it is used to free up any unmanaged resources used by an object
when its work is finished.
using System;
public sealed class Foo : IDisposable
{
private readonly IDisposable _bar;
public Foo()
{
_bar = new Bar();
}
public void Dispose() => _bar.Dispose();
}