Page 1 of 1

Different suffix for entities and DTOs

Posted: Thu 18 May 2017 01:51
by ultravelocity
I would like to have my EF entities suffixed with *Entity. However I also want to generate DTOs with a *Dto suffix. Is this possible with one model? E.g., UserEntity and UserDto

Re: Different suffix for entities and DTOs

Posted: Mon 22 May 2017 17:17
by Shalex
ultravelocity wrote:I also want to generate DTOs with a *Dto suffix.
This suffix is generated by default. If you want to change it, you can can do this: open your *.edml model, navigate to Tools > Entity Developer > Model Explorer > open the Templates node, select the Data Transfer Object template, press F4 (Properties) and set its DTO Class Name Suffix property.
ultravelocity wrote:I would like to have my EF entities suffixed with *Entity.
There is no the Class Name Suffix property in EntityObject and DbContext templates. Workarounds:
* Model Settings > Synchronization > Model Naming > the Add suffix option (this functionality is slightly different to the one you want)
* right click template in the Templates node of Model Explorer > Copy to Model Folder. Now you can modify the code generation in the way you need