Is it possible to write MyGeneration Templates in F# and how?
I want to开发者_StackOverflow中文版 write a MyGeneration Template File in F#. I know you can target various languages etc VB.NET and C# however for my own selfish benefit I would like to write it in F#.
Anyone one if and how this is possible?
In visual studio you can use T4 templating to generate any type of output using a psudo "asp classic" style syntax, where you intermix your code (F#) and the "output."
Heres a good place to get started: http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx
I'm not sure writing a template in F# would be the best move. Although it could be done by referencing a Class Library (At least in CodeSmith). This way you could move all of your F# logic and processing code into a Visual Studio Class Library and still use it inside of the template.
Thanks -Blake Niemyjski (Author of the CodeSmith CSLA Templates)
精彩评论