Saturday, 9 December 2017

c# - Should 'using' be inside the namespace or outside?







Possible
Duplicate:

href="https://stackoverflow.com/questions/125319/should-usings-be-inside-or-outside-the-namespace">Should
Usings be inside or outside the namespace






Are
there any technical reasons for preferring this



namespace
Foo
{

using System;
using
System.IO;


instead of
the default



using
System;
using System.IO;

namespace
Foo

{


Answer




Eric Lippert href="http://blogs.msdn.com/b/ericlippert/archive/2007/06/25/inside-or-outside.aspx">explains
this.



In general, they're
identical.
However, using statements in the
namespace can see namespaces and aliases included outside the
namespace.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...