Forum:  Custom Templates

Thread:  DTO Annotation for Llblgen Runtime Framework

rlmartins (User)   Posted on: 03-Oct-2016 17:18:07.
I have a LLBLGen Pro Runtime Framework Project where I created a set of "Derived Models". Is it possible to auto generate Data Annotation for the generated DTO Class members?

Walaa (Support Team)   Posted on: 03-Oct-2016 19:06:16.
You can go to the "Code Generation Info" tab, select a field, and thee you can find the Attributes sub tab where you can define extra attributes.

rlmartins (User)   Posted on: 03-Oct-2016 20:28:25.
Walaa, Thanks for the prompt response.

Would it be possible to give me an example on how to decorate the datamembers with Required and/or Length attributes?

Also, can you please point out where in the documentation i can go to reference this?

I noticed that on EF (which i am not using), this is done on the DTO Template that LLBLGen runs during code generation.

Otis (LLBLGen Pro Team)   Posted on: 04-Oct-2016 09:54:44.
Examples / step by step:

Entity model (but the same applies to derived model)

Derived model: