Namespace-only class visibility in C#/.NET?

前端 未结 5 1896
温柔的废话
温柔的废话 2020-12-09 14:45

In C#, can you make a class visible only within its own namespace without living in a different assembly? This seems useful for typical helper classes that shouldn\'t be use

5条回答
  •  感情败类
    2020-12-09 14:50

    If you have a single assembly you can define as many namespaces in that assembly as you want but no matter what modifier you apply in the IDE you will always be able to see the classes in other namespaces.

提交回复
热议问题