<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: T4 Tutorial: Creating complex code generators</title>
	<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/</link>
	<description>Interfaces are like alcohol - they are a lot of fun when used in moderation.</description>
	<pubDate>Sat, 04 Feb 2012 05:39:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Igor</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3456</link>
		<dc:creator>Igor</dc:creator>
		<pubDate>Wed, 28 Sep 2011 11:02:20 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3456</guid>
		<description>Hi to everyone! It`s great tutorial! Thanks to author!
I have one question. Can I start generating t4 templates from consol application?</description>
		<content:encoded><![CDATA[<p>Hi to everyone! It`s great tutorial! Thanks to author!<br />
I have one question. Can I start generating t4 templates from consol application?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3455</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Tue, 27 Sep 2011 15:58:32 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3455</guid>
		<description>Hey Oleg,

I answered my own question. It looks like MaximumLength will work, but it returns a -1 if it's a nvarchar(max). It returns the length if it's a different size. Thanks again for the article.</description>
		<content:encoded><![CDATA[<p>Hey Oleg,</p>
<p>I answered my own question. It looks like MaximumLength will work, but it returns a -1 if it&#8217;s a nvarchar(max). It returns the length if it&#8217;s a different size. Thanks again for the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3454</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Tue, 27 Sep 2011 15:51:29 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3454</guid>
		<description>Hi Oleg. Thanks for the great tutorial. Is there a way to get the length of an nvarchar? All of my update/inserts with nvarchar are defualting to one character. I tried grabbing the DataType MaximumLength property to I could add that to the paramters, but with no luck.</description>
		<content:encoded><![CDATA[<p>Hi Oleg. Thanks for the great tutorial. Is there a way to get the length of an nvarchar? All of my update/inserts with nvarchar are defualting to one character. I tried grabbing the DataType MaximumLength property to I could add that to the paramters, but with no luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felix</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3406</link>
		<dc:creator>Felix</dc:creator>
		<pubDate>Mon, 25 Apr 2011 05:15:29 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3406</guid>
		<description>I am sure this example worked with VS2008 and SQL Server 2008. However, with VS2010SP1 and SQL 2008R2 I am getting an error that the script can't connect to the server. After some analysis, looks like the problem is that CrudProcedureGenerator opens connection to the server, and then for every table in the database DeleteProcedureTemplate attempts to open another connection. Once I created DeleteSubProcedureTemplate where I pass Table object instead of string from the loop - it works fine.

Obviously, there is downside for real-life situation (caller has to open db connection) - but for T4 example it's good enough... at least it works!</description>
		<content:encoded><![CDATA[<p>I am sure this example worked with VS2008 and SQL Server 2008. However, with VS2010SP1 and SQL 2008R2 I am getting an error that the script can&#8217;t connect to the server. After some analysis, looks like the problem is that CrudProcedureGenerator opens connection to the server, and then for every table in the database DeleteProcedureTemplate attempts to open another connection. Once I created DeleteSubProcedureTemplate where I pass Table object instead of string from the loop - it works fine.</p>
<p>Obviously, there is downside for real-life situation (caller has to open db connection) - but for T4 example it&#8217;s good enough&#8230; at least it works!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3393</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Thu, 07 Apr 2011 15:06:25 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3393</guid>
		<description>I have got the generator setup working fine, but I also have an include of helper functions for the base template (here it is DeleteProcedureTemplate.tt) and I think I am running into nested type issues.

Basically, I had all the helper functions public and the compiler complained I couldn't access them unless they were static - so I made them all static and then I couldn't use things like this.WriteLine (obvious in hindsight I suppose :).

What is the best way of doing this? i.e. have another include of helper functions accessible to the actual template.

Thanks!
Dan</description>
		<content:encoded><![CDATA[<p>I have got the generator setup working fine, but I also have an include of helper functions for the base template (here it is DeleteProcedureTemplate.tt) and I think I am running into nested type issues.</p>
<p>Basically, I had all the helper functions public and the compiler complained I couldn&#8217;t access them unless they were static - so I made them all static and then I couldn&#8217;t use things like this.WriteLine (obvious in hindsight I suppose :).</p>
<p>What is the best way of doing this? i.e. have another include of helper functions accessible to the actual template.</p>
<p>Thanks!<br />
Dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seishin</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3364</link>
		<dc:creator>seishin</dc:creator>
		<pubDate>Mon, 21 Feb 2011 15:34:38 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-3364</guid>
		<description>About the behaviou described in #8 &#38; 9 - the file is generated after "our" generator runs.. is there a way to force our generator to run after the default output is created?</description>
		<content:encoded><![CDATA[<p>About the behaviou described in #8 &amp; 9 - the file is generated after &#8220;our&#8221; generator runs.. is there a way to force our generator to run after the default output is created?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Code Generator Built Right into Visual Studio &#171; www.ryanstevens.co.uk</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-2997</link>
		<dc:creator>Code Generator Built Right into Visual Studio &#171; www.ryanstevens.co.uk</dc:creator>
		<pubDate>Tue, 20 Apr 2010 07:38:28 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-2997</guid>
		<description>[...] Creating complex code generators [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Creating complex code generators [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-2902</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Tue, 16 Feb 2010 19:15:27 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-2902</guid>
		<description>Good tip, Stanislav. Thanks! It's too bad this workaround generates a warning.</description>
		<content:encoded><![CDATA[<p>Good tip, Stanislav. Thanks! It&#8217;s too bad this workaround generates a warning.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stanislav Kniazev</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-2901</link>
		<dc:creator>Stanislav Kniazev</dc:creator>
		<pubDate>Tue, 16 Feb 2010 15:27:26 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-2901</guid>
		<description>This is in reply to ##8&#38;9: I've found a bug that looks more like feature that allows to suppress an output file generation - specify an invalid extension in output directive like this:
&lt;code&gt;
&lt;#@ output extension="\n" #&gt;
or 
&lt;#@ output extension="\\" #&gt;
or
&lt;#@ output extension="?" #&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>This is in reply to ##8&amp;9: I&#8217;ve found a bug that looks more like feature that allows to suppress an output file generation - specify an invalid extension in output directive like this:<br />
<code><br />
< #@ output extension="\n" #><br />
or<br />
< #@ output extension="\\" #><br />
or<br />
< #@ output extension="?" #><br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-2647</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Sun, 27 Dec 2009 21:19:16 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/#comment-2647</guid>
		<description>Peter, thanks for pointing this out. I have updated the article.</description>
		<content:encoded><![CDATA[<p>Peter, thanks for pointing this out. I have updated the article.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

