I\'m going through some old C#.NET code in an ASP.NET application making sure that all SqlConnections are wrapped in using blocks.
Yes it will still call dispose.
Run this very simple console application top verify:
class Program
{
static void Main(string[] args)
{
TestMethod();
Console.ReadLine();
}
static string TestMethod()
{
using (new Me())
{
return "Yes";
}
}
}
class Me : IDisposable
{
#region IDisposable Members
public void Dispose()
{
Console.WriteLine("Disposed");
}
#endregion
}