Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. is it ok to put enum outside namespace ?

is it ok to put enum outside namespace ?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    israeli
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • I israeli

      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

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups