Where can I find documentation about the provided objects inside T4 templates in ED?
We need to slightly change the provided templates which generates the dbcontext and model. It would be very helpful to find a documentation about classes like EntityContextModel or CsModelCodeProvider in the namespace EntityDeveloper.EntityFramework.
What is the idea of how customers deal with these templates?
Regards, Thomy
How to customize T4 templates in ED
Re: How to customize T4 templates in ED
Our documentation doesn't include reference for classes used in the templates, but there are some tips:
- http://www.devart.com/entitydeveloper/e ... eloper.chm (do Properties > Unblock if content is not displayed) > Template System Concepts
- use IntelliSense feature in our T4 Editor (completion list appears when you type the '.' character)
- you can switch to the model in design time to read a description of a particular property in the Properties window
- general T4 reference: http://msdn.microsoft.com/en-us/library/bb126478.aspx
-
- Posts: 2
- Joined: Thu 11 Aug 2016 17:09
Re: How to customize T4 templates in ED
Thanks for your reply. Although this is a bit bad news. Since debugging code the T4 template in ED is not possible, accessing variables like model results in try-and-error session.
The documentation in Templage System Concepts is pretty good, but it basically describs the T4 concept itself but not the specific data structures and parameters in which the template is executed.
As an example, we would like to extend the generated POCO with a DebuggerDisplayAttribute on the POCO-class. For the value-parameter I need the name of the primary key of the entity. I'm sure that there is a way to find this information somewhere in the ContextModel, but I have no way to definively find it out.
There are more requirements to implement like that.
So I would suggest to extend the documentation and describe all the context objects in which code generation happens so that your customers are able to write their own T4 templates.
The documentation in Templage System Concepts is pretty good, but it basically describs the T4 concept itself but not the specific data structures and parameters in which the template is executed.
As an example, we would like to extend the generated POCO with a DebuggerDisplayAttribute on the POCO-class. For the value-parameter I need the name of the primary key of the entity. I'm sure that there is a way to find this information somewhere in the ContextModel, but I have no way to definively find it out.
There are more requirements to implement like that.
So I would suggest to extend the documentation and describe all the context objects in which code generation happens so that your customers are able to write their own T4 templates.
Re: How to customize T4 templates in ED
Thank you for your suggestion about improving documentation. We will notify you when it is implemented. There is no timeframe at the moment.