Changing template files to remove "My" prefix in generated code

Posts   
 
    
ccsdev
User
Posts: 7
Joined: 13-Dec-2006
# Posted on: 13-Dec-2006 16:40:54   

The code generated with the default templates adds a "My" prefix in the file/class name in "EntitySubClasses" folder.

Changed the templates to use just the Entityname (More details below). E.g., In "derivedEntityAdapter.template" file, changed

"My<[CurrentEntityName]>Entity"

to

<[CurrentEntityName]>

The file/class name in the "EntitySubClasses" folder now use the same name as the table in the database.

Any feedback on this approach would be greatly appreciated (like problems when template structure changes in future versions, any other better approach etc.)

Thanks in advance!

================

More Details:


Environment:

SQL Server 2000 SP3, Microsoft .Net Framework 2.0, Using Remoting

LLBLGenPro v2.0.0.0 Release Date 27-nov-2006

Preset: SD.Presets.AdapterTwoClasses2005

Change Description:

Using the default templates out-of-the-box, the generated code in EntitySubClasses folder has:

FileName: MyCustomerEntity.cs Class name: public partial class MyCustomerEntity : CustomerEntity, ISerializable

Removed "My" prefix and "Entity" suffix in the following templates so that the generated code uses the database table name for file/class name in "EntitySubClasses" folder.


Template Files Affected:

Folder: C:\Program Files\Solutions Design\LLBLGen Pro v2.0\Templates\SharedTemplates\Net2.x\C#

Files:

  1. SD.Presets.Adapter.TwoClasses2005.preset
  1. derivedEntityAdapter.template
  2. derivedEntityFactoriesAdapter.template
  3. entityUsingDerivedAdapter.template
  4. inheritanceInfoProviderDerived.template

Change Details:

My[elementName]Entity.[extension] Changed to [elementName].[extension]

My<[CurrentEntityName]>Entity Changed to <[CurrentEntityName]>

My<[RelatedEntityName]>EntityFactory() Changed to <[RelatedEntityName]>Factory()

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Dec-2006 05:09:59   

Please follow the steps mentioned in the following thread to have your custom template set instead of modifying the original template set http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6880