Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opinions On Using Using
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Opinions On Using Using
Divers
Thread ID:
01471931
Message ID:
01471931
Vues:
107
I read somewhere that when you create a class you should implemente IDisposable so that you can wrap instances of your class in a using statement:
class Customer : IDisposable
{
    public void Dispose()
    {
            
    }
}
and
List<Customer> Customers = new List<Customer>();

foreach (Customer customer in Customers)
{
    using (customer)
    {
        // Do something
    }
}
I would like to know what you guys think on this. Thanks
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform