Top "Idisposable" questions

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

ASP MVC: When is IController Dispose() called?

I'm going through a big refactoring / speed tweaking of one of my larger MVC apps. It has been deployed to …

asp.net-mvc linq-to-sql garbage-collection idisposable
What's the purpose of GC.SuppressFinalize(this) in Dispose() method?

I have the following code: public void Dispose() { if (_instance != null) { _instance = null; // Call GC.SupressFinalize to take this object …

c# .net garbage-collection idisposable suppressfinalize
Implementing IDisposable on a subclass when the parent also implements IDisposable

I have a parent and child class that both need to implement IDisposable. Where should virtual (and base.Dispose()?) calls …

c# .net inheritance idisposable
Proper IntPtr use in C#

I think I understand the use of IntPtr, though I'm really not sure. I copied the IDisposable pattern from MSDN …

c# idisposable intptr
Am I implementing IDisposable correctly?

This class uses a StreamWriter and therefore implements IDisposable. public class Foo : IDisposable { private StreamWriter _Writer; public Foo (String path) { // …

c# idisposable
How to handle exception thrown from Dispose?

Recently, I was researching some tricky bugs about object not disposed. I found some pattern in code. It is reported …

.net dispose idisposable
When or if to Dispose HttpResponseMessage when calling ReadAsStreamAsync?

I am using the System.Net.Http.HttpClient to do some client-side HTTP communication. I've got all of the HTTP …

c# .net stream idisposable dotnet-httpclient
When are .NET Core dependency injected instances disposed?

ASP.NET Core uses extension methods on IServiceCollection to set up dependency injection, then when a type is needed it …

dependency-injection asp.net-core .net-core idisposable
Best practice for reusing SqlConnection

I've come from Java experience and am trying to start with C#. I've read SqlConnection SqlCommand SqlDataReader IDisposable and I …

c# .net connection-pooling idisposable sqlconnection
What does Process.Dispose() actually do?

In C# class Process inherits from class Component that implements IDisposable and so I can call Dispose() on any Process …

c# .net idisposable