how to make collection names plural?

Posts   
 
    
noobix
User
Posts: 14
Joined: 06-Nov-2007
# Posted on: 06-Nov-2007 10:03:12   

hi,

let's consider the classic scenario: 2 tables Customer and Order having a 1:m relationship (one customer can have many orders).

After generating the classes I get a CustomerEntity class containing a property named "... OrderCollection Order".

My question is how can I get LLBLGen Pro to generate collection properties in plural like this: public OrderCollection Orders.

That should apply to all generated collection properties of course. We do prefer the plural form in collections names.

Is there a way to achieve that? I don't want to rename the DB tables (Order -> Orders)!

Best regards Tino

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 06-Nov-2007 10:25:22   

Either change the field mapped onto the relation manually in the Designer.

Or if you are using the 2.5 version, you may make use of the Pluralization plugin.

Set the FieldMappedOnOneToManyPattern in the project properties to {$EndEntityName$P}.

Then you have to bind the Singular To Plural Plug-In to the NameSingularToPluralConversion designer event. Please check the section: Setting up pluralization and singularization of names in the LLBLGen Pro manual under "Designer -> Working with plug-ins"