EntityBase Default

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
dmeagor
Posts: 2
Joined: Sat 14 Sep 2019 17:11

EntityBase Default

Post by dmeagor » Sat 14 Sep 2019 17:17

Hi

I need to include the classname in the Entity Base for each Class I create. For example.

Core.Domain.Entity<ContactGroupMember, long>

Is there a way to set this for the default HibernateContectModel, e.g.

Core.Domain.Entity<{{name}}, long>

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

Re: EntityBase Default

Post by Shalex » Tue 17 Sep 2019 12:20

Please copy a predefined NHibernate template to your model folder via the interface of Model Explorer, open it with built-in T4 Editor, navigate to the line 124 and replace

Code: Select all

        string entityBase = cls.GetProperty("EntityBase") as string;
        if (string.IsNullOrEmpty(entityBase))
           entityBase = model.GetProperty("EntityBase") as string;
        if (!string.IsNullOrEmpty(entityBase))
          baseList = string.IsNullOrEmpty(baseList) ? entityBase : entityBase + ", " + baseList;
with

Code: Select all

        string entityBase = cls.GetProperty("EntityBase") as string;
        if (string.IsNullOrEmpty(entityBase))
           entityBase = model.GetProperty("EntityBase") as string;
        if (!string.IsNullOrEmpty(entityBase) && entityBase.Contains("%ClassName%"))
          entityBase = entityBase.Replace("%ClassName%", cls.Name);
        if (!string.IsNullOrEmpty(entityBase))
          baseList = string.IsNullOrEmpty(baseList) ? entityBase : entityBase + ", " + baseList;

dmeagor
Posts: 2
Joined: Sat 14 Sep 2019 17:11

Re: EntityBase Default

Post by dmeagor » Tue 17 Sep 2019 12:27

That's great thanks, might be worth this small feature to the designer as standard.

Is Entity Developer is active development (i.e. new features) or just maintenance now?

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

Re: EntityBase Default

Post by Shalex » Thu 19 Sep 2019 10:26

Entity Developer is developed in scope of supported ORM frameworks: https://www.devart.com/entitydeveloper/ ... ility.html.

Refer to the list of the functionality added in each version: https://www.devart.com/entitydeveloper/history.html.

Post Reply