User Code Region getting erased

Posts   
 
    
tomahawk
User
Posts: 169
Joined: 02-Mar-2005
# Posted on: 16-Jan-2010 00:35:12   

I have the following in my TDL template definition:

<[If IsPrimaryKey ]>[Key]<[EndIf]>
        <[If IsStringField ]>[Size(<[SourceColumnMaxLength]>)]
        [DbType("<[SourceColumnDbType]>(<[SourceColumnMaxLength]>)")]<[EndIf]>
        [Persistent("<[SourceColumnName]>")]<[ UserCodeRegion "AdditionalAttributes" ]>
        // __LLBLGENPRO_USER_CODE_REGION_START AdditionalAttributes
        // __LLBLGENPRO_USER_CODE_REGION_END
        <[EndUserCodeRegion]>
        public <[TypeOfField]> <[EntityFieldName]>
                ....

If I put code in between those region comment lines, it's erased on regeneration. Am I missing something obvious here?

Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 16-Jan-2010 10:42:03   

Do you have more regions called 'AdditionalAttributes' in the template? FOr example, entity templates have that region at the top of the file. It's likely your region is overwritten with the contents of another region with the same name. So include the macro for the field in the name.

Frans Bouma | Lead developer LLBLGen Pro
tomahawk
User
Posts: 169
Joined: 02-Mar-2005
# Posted on: 16-Jan-2010 17:21:07   

That solved it, thanks!