Top "Idisposable" questions

IDisposable is an interface within the Microsoft .NET Framework's Base Class Library (BCL).

Proper use of the IDisposable interface

I know from reading the Microsoft documentation that the "primary" use of the IDisposable interface is to clean up unmanaged …

c# .net garbage-collection idisposable
Use of Finalize/Dispose method in C#

C# 2008 I have been working on this for a while now, and I am still confused about the use of …

c# .net idisposable finalizer
Do HttpClient and HttpClientHandler have to be disposed between requests?

System.Net.Http.HttpClient and System.Net.Http.HttpClientHandler in .NET Framework 4.5 implement IDisposable (via System.Net.Http.HttpMessageInvoker). The …

c# .net-4.5 idisposable using dotnet-httpclient
Should I call Close() or Dispose() for stream objects?

Classes such as Stream, StreamReader, StreamWriter etc implements IDisposable interface. That means, we can call Dispose() method on objects of …

c# stream idisposable streamreader streamwriter
When should I use GC.SuppressFinalize()?

In .NET, under which circumstances should I use GC.SuppressFinalize()? What advantage(s) does using this method give me?

c# .net garbage-collection idisposable suppressfinalize
Should I Dispose() DataSet and DataTable?

DataSet and DataTable both implement IDisposable, so, by conventional best practices, I should call their Dispose() methods. However, from what …

datatable dataset dispose idisposable using
Entity Framework and calling context.dispose()

When should one call DbContext.dispose() with entity framework? Is this imaginary method bad? public static string GetName(string userId) { …

entity-framework dbcontext idisposable
Manually destroy C# objects

I am fairly new to learning C# (from Java & C++ background) and I have a question about manual garbage …

c# destructor idisposable using
Is IDisposable.Dispose() called automatically?

Possible Duplicate: Will the Garbage Collector call IDisposable.Dispose for me? I have a Class which has some unmanaged resources. …

c# .net idisposable
returning in the middle of a using block

Something like: using (IDisposable disposable = GetSomeDisposable()) { //..... //...... return Stg(); } I believe it is not a proper place for a return statement, …

c# dispose idisposable using-statement