Most C# developers place their using
directives outside the namespace, i.e. at the top of the file just before the namespace declaration, like so:
using System;
using System.IO;
namespace MyProject.Web
{
public class MyClass
{
...
}
}
However, Microsoft itself seems to place their using
directives sometimes inside the namespace, immediately after the namespace declaration. This which makes them part of the namespace I presume. Here is an example:
namespace MyProject.Web
{
using System;
using System.IO;
public class MyClass
{
...
}
}
Why would they do that?
Are their any advantages to doing it either way?