Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> How Do I Modify the Plural Names of Top-Level Queries in the Generated Entity Framework DataContext class?
 

Pages: 1
LLBLGen Pro Runtime Framework
How Do I Modify the Plural Names of Top-Level Queries in the Generated Entity Framework DataContext class?
Page:1/1 

  Print all messages in this thread  
Poster Message
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 10-May-2015 14:38:48.  
My entities defined in the designer are singular names and I see that LLBLGen is generating plurals for their DbSet collections in the generated DataContext class. However, some of the plural forms are incorrect grammar and I'd like to fix that.

How do I override the default plural form of singular entity names in the designer so that generated code uses the plural names I want?

I'm using v4.2 Final (Feb 16 2015).
  Top
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 10-May-2015 14:42:05.  
Emmanuel wrote:
My entities defined in the designer are singular names and I see that LLBLGen is generating plurals for their DbSet collections in the generated DataContext class. However, some of the plural forms are incorrect grammar and I'd like to fix that.

How do I override the default plural form of singular entity names in the designer so that generated code uses the plural names I want?

I'm using v4.2 Final (Feb 16 2015).


I thought I'd found the solution (click "New sequence..." in the entity's "Field Mappings" tab. But when I generate code, it still uses the default plural name.


  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8110 posts
# Posted on: 10-May-2015 22:13:14.  
Hi Emmanuel,

If the pluralization of collections doesn't suits you, you could just rename those navigators individually in the LLBLGen Designer. The pluralization will run again for new elements, not for the one you just renamed.

If you want to totally disable the pluralization plugin's event, you can do it as well, this is how.

You could even download the SourceCode package from the LLBLGen's Customer section and modify the Singularization/PlurarizationPluglin to your needs (adding additional grammar exceptions, for instance).
David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 10-May-2015 22:48:40.  
daelmo wrote:

If the pluralization of collections doesn't suits you, you could just rename those navigators individually in the LLBLGen Designer. The pluralization will run again for new elements, not for the one you just renamed.

But how do I rename them at the top-level? In other words, the ones that result in the generation of DbSet<TEntity> properties of the generated DataContext?

(Also, just discovered another pluralisation issue. See http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=23328)




  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37879 posts
# Posted on: 11-May-2015 12:03:56.  
The pluralization is done through the plugin. If some names aren't pluralized properly, I'd look at the plugin source (it's shipped with the sourcecode archive, available in the customer downloads on the website) It's a straightforward piece of code which works with a set of exceptions together with a general pluralization algorithm (it's OSS code actually from the castle lib).

Would that work for you?
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.