Can These tests be done in TDL?

Posts   
 
    
Innes avatar
Innes
User
Posts: 45
Joined: 18-Jun-2004
# Posted on: 25-Jun-2005 15:28:38   

Can somebody confirm whether the following tests (tests that are equivalent to the hypothetical TDL fragments below) are possible in TDL:

1) Test whether the 'currentEntityField' is backed by a nullable column. e.g: <[If IsNullable]>...

I'd like to be able to do this, so I can generate Clear[fieldname] functions which set the field to null (nicer than using SetCurrentFieldValue((int)EntityFieldIndex.FieldName, null). (I can just generate these for all fields, but this will result in some functions that should not be used)

2) Test whether the 'currentEntityField' is tagged with a particular custom property. e.g: <[If HasCustomProperty "IsBooleanCharacterField"]>...

I would like to be able to tag single-character fields to be treated as 'boolean' fields, and generate property accessors/mutators that translate the boolean value to/from 'Y' and 'N'.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39788
Joined: 17-Aug-2003
# Posted on: 27-Jun-2005 11:33:37   

Both are not available right now.

I'm not sure if you're generating new classes or that you're trying to write include templates. If you're writing templates which generate new classes, you could try the .lpt template engine, which uses the common 'asp-style' of template writing, and you then can use C# or VB.NET for your template language and have all freedom to access teh complete object graph of the project. TDL has a fixed set of statements and these can be pretty limiting in some areas.

For include templates, you now have to use TDL still. This will change in 1.0.2005.1 where .lpt templates will be usable as include templates in TDL templates.

Frans Bouma | Lead developer LLBLGen Pro