Different suffix for entities and DTOs

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
ultravelocity
Posts: 1
Joined: Thu 18 May 2017 01:48

Different suffix for entities and DTOs

Post by ultravelocity » Thu 18 May 2017 01:51

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

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Different suffix for entities and DTOs

Post by Shalex » Mon 22 May 2017 17:17

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

Post Reply