is it ok to put enum outside namespace ?
-
Hi, Is it right to put an enum outside the namespace? I'm using it in my ASP.NET programs and it makes everything easier since the new types are accessable among all the classes and modules. Does it make my code working but not O.O. ? and if it's o.k. are there other entities I can define outside the namespace in order to make them global ? such as structures or constants ? Thanks
-
Hi, Is it right to put an enum outside the namespace? I'm using it in my ASP.NET programs and it makes everything easier since the new types are accessable among all the classes and modules. Does it make my code working but not O.O. ? and if it's o.k. are there other entities I can define outside the namespace in order to make them global ? such as structures or constants ? Thanks
israeli wrote:
Is it right to put an enum outside the namespace?
It's OK.
israeli wrote:
Does it make my code working but not O.O. ?
No, it's still OO
israeli wrote:
and if it's o.k. are there other entities I can define outside the namespace in order to make them global ? such as structures or
Struct, but not Const. For more information, you can see C# Language Specification[^]. Btw, I think your question should belong to the C# forum.