You would advise you: never use default namespace, always put the whole file of the code like this in a certainly named name space. I refer to the source code you have shown in response to the question by Rod.
For example, create a namespace
MyCompany.MyProduct.Authentication
and put the code you have shown in this namespace.
When you want to use the type
User
in some other place, your options are:
- Refer it in fully-qualified name:
MyCompany.MyProduct.Authentication.User
; - Use the namespace clause
using MyCompany.MyProduct.Authentication;
- Use the alias clause
using User = MyCompany.MyProduct.Authentication.User;
.
This syntax is a part of very basic language knowledge. You are doing a common mistake: trying to develop something advanced without sufficient knowledge of the language. Do yourself a great favor: at least read the language manual from the beginning to the end; it won't take any time which you would regret later. It will pay off pretty soon.
—SA