Page 1 of 1

DbContext template - default namespace

Posted: Sun 08 Nov 2015 23:36
by smokeing
Hi,

how to specify namespace for generated entities and context classes?
There is an option "Entities Output" but you can only specify project and project folder.
We are looking for this, because we would like to exclude them from code coverage analysis.

smokeing

Re: DbContext template - default namespace

Posted: Mon 09 Nov 2015 11:22
by MariiaI
Open Properties for your model (for example, right-click the diagram layout and select Properties) and:
1) For context class: set Entity Container Namespace, for example, to MyNamespaceModel;
2) For entities: set Namespace, for example, to MyNamespaceModel_Entities;
3) Save the changes to regenerate the code.

Another way is to make it via Model Settings ( double-click the diagram layout):
1) set Entity Container in the following way: MyNamespaceModel.MyContext
2) set Namespace in the following way: MyNameSpace_Entities

Please refer to the corresponding Entity Developer documentation:
http://www.devart.com/entitydeveloper/e ... eloper.chm > ORM Support -> Entity Framework -> Reference -> Dialog Windows -> Model Settings
http://www.devart.com/entitydeveloper/e ... eloper.chm > ORM Support -> Entity Framework -> Reference -> Model Properties

JIC: Entity Developer documentation is also available with the installation package (the "Help" component should have been selected when installing).

Re: DbContext template - default namespace

Posted: Mon 09 Nov 2015 16:50
by smokeing
Thank you very much!

Re: DbContext template - default namespace

Posted: Tue 10 Nov 2015 08:33
by MariiaI
If we can assist you any further, don't hesitate to contact us.