Hi,
I just wondered if there is any way to stop the file names that are generate for the NHibernate entities and mapping files being prefixed with the model name.
For example, if my model name is TestModel, all the generated files come out as :-
TestModel.Xxxxxxx.cs etc...
I just want the name to be Xxxxxx.cs without the model name prefix.
Many thanks
Simon
NHibernate File Names
Re: NHibernate File Names
For this, you should modify a code generation template manually:
1) right click on the template in Model Explorer > Copy to Model Folder
2) open template and replace
with
3) save template and regenerate the code.
1) right click on the template in Model Explorer > Copy to Model Folder
2) open template and replace
Code: Select all
string rootFileName = baseFileName + "." + cls.Name;
Code: Select all
string rootFileName = cls.Name;
Re: NHibernate File Names
The naming stategy of ED is indeed odd, IMHO.
I hope this will change in a future release because I'd rather not change the standard template manually.
I hope this will change in a future release because I'd rather not change the standard template manually.
Re: NHibernate File Names
Generating names like TestModel.Xxxxxxx.cs is a common feature of different ORM designers. Different models within a project may have classes with the same name; as a result one file overwrites another one when naming Xxxxxxx.cs is used.