Create new entity

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
software931
Posts: 10
Joined: Tue 18 Sep 2012 07:55

Create new entity

Post by software931 » Fri 09 Aug 2013 13:34

The entity developer is creating automatically for each table a method

CreateTablename(List of initial parameter)


The parameter includes all columns, which are not null-able inside the database.
I would like, that the entity developer is creating this method with
Primary Key-Columns only, because the other columns will be set later, but not when creating the new entity.

Is there a possibility to configure it?

Kind regards
Peter

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

Re: Create new entity

Post by Shalex » Wed 14 Aug 2013 16:43

software931 wrote:The entity developer is creating automatically for each table a method
CreateTablename(List of initial parameter)
The parameter includes all columns, which are not null-able inside the database.
We consider this is a correct behaviour. The standard EDM Wizard works in the same way.
software931 wrote:I would like, that the entity developer is creating this method with
Primary Key-Columns only, because the other columns will be set later, but not when creating the new entity.
Is there a possibility to configure it?
Yes, you can do that by editing a predefined template. Right click on a template in Model Explorer > Copy to Model Folder and modify GenerateClassStaticMethod with embedded T4 Editor.

Be aware this local (copied to the project folder) template would not be updated during reinstall of Entity Developer. In this case, if you want to use the updated template, disable the local one and add the "global" template via Model Explorer > Add Template menu after installing the new version of Entity Developer. Or merge the new template with yours.

Post Reply