Top "Idisposable" questions

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

How to return a Stream from a method, knowing it should be disposed?

I have a method that takes FileStream as input. This method is running inside a for loop. private void UploadFile(…

c# stream using idisposable
Questions about Entity Framework Context Lifetime

I have some questions about the desired lifetime of an Entity Framework context in an ASP.NET MVC application. Isn't …

c# asp.net-mvc entity-framework using idisposable
type used in a using statement must be implicity convertible to system.Idisposable

Started a new mvc4 project. Used the MVC controller template to create the read/write actions of the 'Orders' Model. …

c# asp.net asp.net-mvc-4 idisposable devforce
Using IDisposable to unsubscribe events

I have a class that handles events from a WinForms control. Based on what the user is doing, I am …

.net events idisposable unsubscribe
With... End With vs Using in VB.NET

I just found out that like C#, VB.NET also has the using keyword. Until now I thought it didn't …

vb.net scope idisposable using-statement with-statement
When should I implement IDisposable?

What is the best practice for when to implement IDisposable? Is the best rule of thumb to implement it if …

c# .net vb.net idisposable
Should Closeable be used as the Java equivalent for .NET's IDisposable?

Update: As @PaulGroke points out below, things have changed with Java 7: there now is AutoCloseable. Which isn't tied to streams …

java idisposable
yield return statement inside a using() { } block Disposes before executing

I've written my own custom data layer to persist to a specific file and I've abstracted it with a custom …

c# .net-2.0 idisposable using yield-return
Using C#'s 'using' statement with a custom object's function, do I Need to implement IDisposable?

I have an sqlConnection manager class like so: public class SQLConn { public string connStr = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]; private …

c# idisposable sqlconnection
Do I need to close a .NET service reference client when I'm done using it

I'm trying to find out if it is neccessary to close a .net service reference client when you are done …

c# .net wcf web-services idisposable