Page 1 of 1
EntityBase Default
Posted: Sat 14 Sep 2019 17:17
by dmeagor
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>
Re: EntityBase Default
Posted: Tue 17 Sep 2019 12:20
by Shalex
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;
Re: EntityBase Default
Posted: Tue 17 Sep 2019 12:27
by dmeagor
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?
Re: EntityBase Default
Posted: Thu 19 Sep 2019 10:26
by Shalex
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.