Singular to Plural Fields

Posts   
 
    
Filomeno
User
Posts: 14
Joined: 24-Oct-2007
# Posted on: 27-May-2008 13:12:01   

Hello Experts,
Is it possible to have a template for me to include some conditional statement in pluralizing a fields that are mapped from relationship? I badly need to know this feature so that I could achieve some of my goals in renaming the fields. I know I can achieve this by explicitly rename the field but it is somehow helpful to have a template or some area to be configured to have it automatic after refreshing the catalog. a) In CustomerEntity o Rename Order Field to Orders b) In OrderEntity o Rename OrderLine Field To OrderLines

I simply achieve this by putting 's' at the end of FieldMappedOnOneToMannyPattern property of the project. But since there are fields that ends with 'y', 's', or 'ss', just like having foreign tables 'News', "Address' or 'Assembly'. So there will be fields like 'Addresss', 'Newss', or 'Assemblys' which is not good. How is it possible to have a good plural field name? Instead of having: o Addresss, should be changed to Addresses o News, stick with it o Assembly, should be changed to Assemblies

Thanks

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 27-May-2008 19:44:40   

You can customize the generation templates, please see Template Studio in the documentation. Keep in mind that you must implement the pluralizing algorithm, I'm sure there are plenty examples of this in the web.

Filomeno
User
Posts: 14
Joined: 24-Oct-2007
# Posted on: 28-May-2008 04:43:33   

Which template do i need to customize with template studio?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 28-May-2008 10:58:22   

I think all the pluralization rules have been taken care of, so you don't need to modify anything.

Anyway the following is copied from the manual:

These plug-ins are based on the Castle Project's Inspector class for singularization/pluralization of English names. As this is an Open Source project, the sourcecode of this class is available in the SDK sourcecode, available to all LLBLGen Pro customers in the customer area.

Hint: check the Inflector.cs file for all rules. (SDK\Sourcecode\Plugins)

Filomeno
User
Posts: 14
Joined: 24-Oct-2007
# Posted on: 28-May-2008 13:42:07   

I have already found the solution to my problem. After looking into plug-in I was able to follow the logic and binds to an event.

Thanks

Pablo
User
Posts: 81
Joined: 21-Mar-2005
# Posted on: 19-Nov-2013 10:57:04   

sorry ...