prefix or suffix entity names when generating for EF

Posts   
 
    
Posts: 35
Joined: 07-Jun-2016
# Posted on: 19-Jul-2016 17:47:04   

llblgen version: 5

Is it possible to prefix or suffix entity names when generating for Entity Framework? I don't see a way to do this.

Thanks for any direction.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 19-Jul-2016 19:52:58   

Could you please provide a use case, what you need this for, and what kind of prefix you need?

Posts: 6
Joined: 19-Jul-2016
# Posted on: 19-Jul-2016 21:04:58   

We actually would like to add a suffix to the entities to distinguish them from our view model objects. We have used the LLBL Gen run-time since 2.6 and have gotten used to the Entity suffix.

In an example, we have a Log table that generated as LogEntity using the LLBLGen run-time, but with EF it's just Log. Since this is a common name, we don't want to run into naming conflicts across namespaces not to mention clarity when reading code.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 21-Jul-2016 11:28:00   

This is currently not supported, primarily because feedback on our own framework actually suggested to get rid of the suffix, so we removed it.

It's an item in our tracker to add in the future (i.e. more flexibility to output naming, also namespaces etc.), currently it's not supported at this level. You could rename the entities in the designer with the suffix 'Entity' but that likely gives odd names on the Context class. (you can do this in bulk btw, in the element search window, where you can write a small piece of C# to traverse the entities in the model and suffix the name)

One thing I wondered though: with namespaces, you could limit the conflicts though?

Frans Bouma | Lead developer LLBLGen Pro
skomov
User
Posts: 1
Joined: 03-Aug-2016
# Posted on: 03-Aug-2016 18:33:39   

LLBLGen Pro Designer, 5.04 ver. Why do Entities have a different names (singular instead multiple as it's provided Database schema)? For example, DeletedPunches -> DeletePunchEntity.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 03-Aug-2016 19:08:07   

That's a completely different question than the subject of this thread, please follow the forum guidelines and open a new thread.