tags:

views:

70

answers:

1

Hi :)

Is there any way to make the generated linq classes stay inside a namespace? The reason being that im working on a big project, and there is alot of tables with different names, and i dont want them to be accessable from anywhere in the project, unless we add the namespace..

I know thats already implemented in the entity framework, but until they get that running smooth im not using it again..

I have two ideas, but haven't tried any of them yet. 1. Editing the generated linq class, sorrounding the entire block in a namespace, but that would require me to edit the file manually every time a change is made, another table is added and so on. 2. Removing the dbml file from the app_code folder, but that might not be a good idea.

Thanks in advance :)

+1  A: 

SqlMetal

sqlmetal has a /namespace option.

Visual Studio

If you right click on the background of the DBML designer and choose properties you'll be able to set one namespace for the context and another, possibly the same, one for the entities.

drs9222
Awesome, exactly what i was looking for.
Moulde
It works :) But giving the same name to both the context and the entities throws an error when executed.
Moulde