views:

335

answers:

1

Suppose the root project has My.Root.Project namespace. I wonder what namespace should be assigned to an area classes? Possible alternatives:

  1. My.Root.Project.Areas.Area1
  2. My.Root.Project.Area1

Esthetically, I prefer second one.
However, since I use a single-project areas, all the classes created within Areas\Area1\... folder are given long namespace My.Root.Project.Areas.Area1 by default. There is too much stupid work in getting rid of the Areas part in every created class by hands.
How to prevent Areas from being included into namespace?

A: 

I personally like the second one.

I think that you can do one of the following things:

  • If this is a stand alone project you can call him whatever name you want.

  • If this is a folder in another project, in the properties of the areas folder you can choose: Namespace Provider: False.

Mendy
It would be perfect, but I have no **Namespace Provider** property for the folder, only **Folder name**. I'm in VS2008.
Anton
In order to have this property you need to have ReSharper installed.
Mendy
Unfortunately, I haven't.
Anton
Seems like there is no other way to avoid automatic insertion of `Areas` into namespace. Accepting despite of can't use it :)
Anton