Is this example right? The documentation is slightly different:
https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose
One of the methods signature is different:
protected override void Dispose(bool disposing)
not
public virtual void Dispose(bool disposing)
and at the end of this method the disposed field is set to true.