Different suffix for entities and DTOs
-
- Posts: 1
- Joined: Thu 18 May 2017 01:48
Different suffix for entities and DTOs
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
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 also want to generate DTOs with a *Dto suffix.
There is no the Class Name Suffix property in EntityObject and DbContext templates. Workarounds:ultravelocity wrote:I would like to have my EF entities suffixed with *Entity.
* 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