Possible Duplicate:
using statement with multiple variables
I have several disposable object to manage. The CA2000 rule ask me to dispose all my object before exiting the scope. I don't like to use the .Dispose()
method if I can use the using clause. In my specific method I should write many using in using:
using (Person person = new Person()) {
using (Adress address = new Address()) {
// my code
}
}
Is it possible to write this on another way like:
using (Person person = new Person(); Adress address = new Address())