Will Dispose() be called in a using statement with a null object?
Is it safe to use the using statement on a (potentially) null object? Consider the following example: class Test { IDisposable GetObject(string name) … Read more
Is it safe to use the using statement on a (potentially) null object? Consider the following example: class Test { IDisposable GetObject(string name) … Read more
DataSet and DataTable both implement IDisposable, so, by conventional best practices, I should call their Dispose() methods. However, from what I’ve read so … Read more
For example, I rarely need: using System.Text; but it’s always there by default. I assume the application will use more memory if your … Read more
This question already has answers here: What are the uses of “using” in C#? (29 answers) Closed 7 years ago. What is the … Read more
In a MySQL JOIN, what is the difference between ON and USING()? As far as I can tell, USING() is just more convenient … Read more
User kokos answered the wonderful Hidden Features of C# question by mentioning the using keyword. Can you elaborate on that? What are the … Read more
I am working on a project. I have to compare the contents of two files and see if they match each other precisely. … Read more
System.Net.Http.HttpClient and System.Net.Http.HttpClientHandler in .NET Framework 4.5 implement IDisposable (via System.Net.Http.HttpMessageInvoker). The using statement documentation says: As a rule, when you use an … Read more
I like instantiating my WCF service clients within a using block as it’s pretty much the standard way to use resources that implement … Read more