This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I would like to know if there is any way to either customize the class properties that are auto-generated via a T4 template, or via implementing some sort of generator interface on a class and pointing the Designer at the custom generator vs the built in one. |
|
|
The code generation templates are NVelocity templates and can be freely edited. See http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html for a guide to Velocity Template Language. However, at the moment, it is not possible to store custom templates on a per-project basis (and therefore as part of project source control). You'd therefore need to edit the templates at the install location, and ensure that you keep copies because they'll be overwritten when you install an updated version. However, we'd be happy to look at adding per-project custom templates for you if you've got a use case for them -- let us know! |
|
|
I am evaluating the tool ATM and what you are suggesting works fine as a work around. All i wanted to do was add [DataMember] attributes on the output classes and add a using System.Runtime.Serialization; line to the model output class. |
|
|
"You'd therefore need to edit the templates at the install location," I undertand that everyone could install into a diffrent spot. But if I picked the default options and am using VS2010, can you give me a hint where the Velocity Template would be? What would be the name of the file that I would need to change. Thanks in advance
|
|
|
Hi, VSIX installations for Visual Studio 2010 get installed under your local app data directory. So you should find the templates in a directory like this (please note to change your username, and possibly version): C:\Users\[USERNAME]\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Mindscape\Mindscape NHibernate Model Designer\1.0.235.15078\Templates\CSharp Please let us know if you have any further questions. John-Daniel |
|
|
My setup appears to be diffrent then what you suggested. Can you give me the name of one file that is 1.0.235.15078\Templates\CSharp directory. Sorry to be a pain. Thanks. |
|
|
The main template file is called Base.vm. |
|