Macros to use in Project Settings Code Generation Attributes

Posts   
 
    
Jan VBM avatar
Jan VBM
User
Posts: 24
Joined: 03-Apr-2011
# Posted on: 09-Dec-2014 14:06:13   

L.S.,

LLBLGenPro 4.2 (19-11-2014) EFv6 i'm experimenting with setting attributes / Data Annotations. I'm using macro's like {$Name} and $true to generate the desired annotations in the EF Model.

I would like to access the Foreign Key Attribute for ElementType "[b]NavigatorSingleValue[/b]" to generate something like

[ForeignKey("MunicipalityNr")]

on NavigatorSingleValue "Municipality" for class BasicAdminUnit; Would that be possible?

Please note that the macro "{$ContainerName}" does not work, in the sense that it does not require the last "}"; ergo "[b]{$ContainerName[/b]" will be enough to access ContainerName value.

tnx

Attachments
Filename File size Added on Approval
ProjectSettingsCodeGenerationAttributes.jpg 94,195 09-Dec-2014 14:06.29 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Dec-2014 16:25:34   

The missing } is a mistake, we'll correct that in the next version (as it's a breaking change).

There's currently no macro for FK fields. The problem is that when the attribute macro's are handled, the handler doesn't know for which element it is, it just gets strings passed in for various macro elements and it then will replace them, but that's it. So it's not able to transform a macro in a series of fk field names at that level at this point.

Is this a requirement for your application? We can add it in the future, but of course that is of no use for you now.

Frans Bouma | Lead developer LLBLGen Pro
Jan VBM avatar
Jan VBM
User
Posts: 24
Joined: 03-Apr-2011
# Posted on: 10-Dec-2014 13:43:29   

We are still in the process of exactly defining the req. (from MVC/presentation layer); made some changes manually, that will do for now. tnx.