Dispose and Finalize are two methods you often use to release resources occupied by your .NET and .NET Core applications running in the context of the CLR. Most importantly, if you have unmanaged resources in your application, you should release the resources occupied by such resources explicitly.
Due to the non-deterministic nature of finalization and because finalizers are costly in terms of performance, the Dispose method is used much more frequently...
далее...