Does the "using" directive provide any benefit?
- by Adam Drummond
Is there a programmatic benefit to using a using statement?
Notice the difference between this sample:
using Application.Data;
namespace Application.Web
{
public class SampleClass
{
public void SampleMethod()
{
List<Category> categories = CreateCategoriesData();
Category expected = categories[0];
...
...
}
}
}
And this one:
namespace Application.Web
{
public class SampleClass
{
public void SampleMethod()
{
List<Data.Category> categories = CreateCategoriesData();
Data.Category expected = categories[0];
...
...
}
}
}