home recent topics recent posts search register faq   AspNetForum v.4.8.2.0

Huagati Systems Support Forum :: Forum

user:
psw:
| lost password
Home » Huagati DBML/EDMX Tools Support » Customizing Table names Messages in this topic - RSS
7/22/2009 12:00:32 PM
MartinH
Posts 7
I'm completely new to this tool, so sorry if it's a ridiculous question...

I have a view that is named vwVentasClienteMes where the last word (Mes) in the camel sequence is Spanish for Month. When I run the Standardize option I want to preserve this name, and don't want the last 's' to be stripped.

How should I go about this?

Thanks,
Martin.
7/22/2009 10:39:27 PM
Kristofer
Posts 256
Hi Martin,

The "s" removed from entity names is caused by the "singularize" naming option - it uses english pluralization and singularization rules so for other languages you may want to set that option to "None".



Best regards,
Kristofer

.
edited by Kristofer on 7/22/2009

Attachments: plurSingOpt.png
7/23/2009 2:35:36 AM
MartinH
Posts 7
Kristofer:

Thanks for the reply. Actually the English pluralization rules are quite good for Spanish, there are some exceptions though.

The answer you suggest, I believe, applies to all the variable names, and in general I do want the pluralization rule allied. There are just a few exceptions I wish to exclude from this treatment.

I have found the 'Exclusions' dialog box and think this might be the way to go. If I go to the Model page of the Exclusions dialog I can mark Objects (Tables) and (Properties) Fields I wish to exclude from Updating. This raises another question. If I want to exclude the vwVentasClienteMes view from the naming rules, but include its properties, how would I go about this?

Regards,
Martin.
7/23/2009 11:40:38 AM
Kristofer
Posts 256
Hi Martin,

I understand...

You're correct - the settings shown in my original reply will apply to all entities. And unfortunately, if a table or view is selected in the exclude dialog it will be ignored entirely by the update feature so if the table/entity itself is excluded then any changes to its' properties will also be ignored.

I will look into the possibility of exposing an interface for customizing the pluralization rules.

Best regards,
Kristofer
7/23/2009 12:41:07 PM
MartinH
Posts 7
Great
8/10/2009 1:59:40 AM
Kristofer
Posts 256
Hi Martin,

Version 1.75 (to be released soon) includes a new extensibility interface allowing pluralization/singularization as well as the entire name rule portion to be customized. This will allow users to add their own pluralizer/singularizer for other languages than English, as well as other name rules where the built in rules are not sufficient.

The new interface is described here: http://www.huagati.com/dbmltools/ExtensibilityHelp/

...and a sample class showing a blank implementation of it can be found here:
http://forum.huagati.com/upload/2/SampleNameTool.cs.txt

Best regards,
Kristofer

.
edited by Kristofer on 8/10/2009
8/10/2009 3:14:11 AM
MartinH
Posts 7
Kristofer:

This extension will be a *real* help to non-English languages, I appreciate the effort.

Regards,
Martin.
8/21/2009 4:00:21 AM
MartinH
Posts 7
Kristofer:

Thanks for the new version. I am very interested in using the new IEntityNameTool interface, and have looked at the definition of the interface and the sample class, but what do I do with these classes?

I suppose I compile them to an library assembly (dll)... Do I have to follow any naming conventions? Where do I place the compiled code so it is 'seen' by the parser?

Thanks,
Martin.
8/23/2009 1:48:51 AM
Kristofer
Posts 256
Hi Martin,

To use the new name customizations interface, create a new class library project / dll that has a reference to the add-in dll (HuagatiDBMLExtensions.dll). Then create a new class in that class library that inherits from the EntityNameTool abstract class and that overrides the abstract methods in that class.

After compiling the DLL, place it in the same directory as the add-in DLL itself. Next, edit the [l2smodel].dbml.namePrefs or [efmodel].edmx.namePrefs xml file(s) for the projects where you want to use the customized name tool and change the setting UseExternalNameTool from false to true, and add a new ExternalNameTool setting right after it with the activation string for the new class.

E.g. the end of the .namePrefs file will look like this:
<UseExternalNameTool>true</UseExternalNameTool>
<ExternalNameTool>SampleNameTool.SampleNameTool, SampleNameTool, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1cc64e6e454a40a4</ExternalNameTool>
</NamePreferences>


I have attached a sample project that implements a sample customized name tool that saves all names, pluralizations, and singularizations in a file and then reads them again from the same file upon subsequent runs. (the activation string in the sample xml above is for the dll created by that sample project)

Best regards,
Kristofer

Attachments: SampleNameTool.zip
4/14/2010 1:27:18 PM
Kristofer
Posts 256
FYI - some changes are coming to the custom naming interface in version 1.87, outlined in more detail here: http://forum.huagati.com/topic124-customizing-naming-with-external-name-tools.aspx
pages: 1
|

Home » Huagati DBML/EDMX Tools Support » Customizing Table names