<?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 template for generating SQL view from C# enumeration</title>
	<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/</link>
	<description>Interfaces are like alcohol - they are a lot of fun when used in moderation.</description>
	<pubDate>Sat, 04 Feb 2012 05:51:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: yauhen</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3473</link>
		<dc:creator>yauhen</dc:creator>
		<pubDate>Fri, 02 Dec 2011 19:50:31 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3473</guid>
		<description>How to get enum value attributes?
By strange reason description of attributes property says that it "returns attributes of parent"</description>
		<content:encoded><![CDATA[<p>How to get enum value attributes?<br />
By strange reason description of attributes property says that it &#8220;returns attributes of parent&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Talking about Oleg Sych – » T4 template for generating SQL view from C# enumeration &#171; EdenSoft Space</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3251</link>
		<dc:creator>Talking about Oleg Sych – » T4 template for generating SQL view from C# enumeration &#171; EdenSoft Space</dc:creator>
		<pubDate>Mon, 27 Sep 2010 19:26:55 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3251</guid>
		<description>[...]  Oleg Sych &#8211; » T4 template for generating SQL view from C# enumeration     Leave a [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;]  Oleg Sych &#8211; » T4 template for generating SQL view from C# enumeration     Leave a [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3181</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Tue, 13 Jul 2010 12:03:32 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3181</guid>
		<description>Justin,

Does your script specify a valid path to the enum file? I can see in how it could throw a NullReferenceException when the file cannot be found.

Oleg</description>
		<content:encoded><![CDATA[<p>Justin,</p>
<p>Does your script specify a valid path to the enum file? I can see in how it could throw a NullReferenceException when the file cannot be found.</p>
<p>Oleg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3171</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Mon, 28 Jun 2010 22:37:57 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3171</guid>
		<description>GetEnum() throws reference not set to an object exception. 

EnvDTE.ProjectItem enumProjectItem = TransformationContext.FindProjectItem("my file path.cs");
enumProjectItem is null;

What am I doing wrong?

Error	1	Running transformation: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.TextTemplatingBB88E5E873511E8E0604412A18F7F962.GeneratedTextTransformation.EnumSqlViewTemplate.GetEnum()
   at Microsoft.VisualStudio.TextTemplatingBB88E5E873511E8E0604412A18F7F962.GeneratedTextTransformation.EnumSqlViewTemplate.TransformText()
   at T4Toolbox.Template.Transform()
   at T4Toolbox.Template.Render()
   at Microsoft.VisualStudio.TextTemplatingBB88E5E873511E8E0604412A18F7F962.GeneratedTextTransformation.TransformText()
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String&#38; result)		1	1</description>
		<content:encoded><![CDATA[<p>GetEnum() throws reference not set to an object exception. </p>
<p>EnvDTE.ProjectItem enumProjectItem = TransformationContext.FindProjectItem(&#8221;my file path.cs&#8221;);<br />
enumProjectItem is null;</p>
<p>What am I doing wrong?</p>
<p>Error	1	Running transformation: System.NullReferenceException: Object reference not set to an instance of an object.<br />
   at Microsoft.VisualStudio.TextTemplatingBB88E5E873511E8E0604412A18F7F962.GeneratedTextTransformation.EnumSqlViewTemplate.GetEnum()<br />
   at Microsoft.VisualStudio.TextTemplatingBB88E5E873511E8E0604412A18F7F962.GeneratedTextTransformation.EnumSqlViewTemplate.TransformText()<br />
   at T4Toolbox.Template.Transform()<br />
   at T4Toolbox.Template.Render()<br />
   at Microsoft.VisualStudio.TextTemplatingBB88E5E873511E8E0604412A18F7F962.GeneratedTextTransformation.TransformText()<br />
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String&amp; result)		1	1</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/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3000</link>
		<dc:creator>Code Generator Built Right into Visual Studio &#171; www.ryanstevens.co.uk</dc:creator>
		<pubDate>Tue, 20 Apr 2010 07:39:19 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-3000</guid>
		<description>[...] T4 template for generating SQL view from C# enumeration [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] T4 template for generating SQL view from C# enumeration [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-2975</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Thu, 08 Apr 2010 14:40:58 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-2975</guid>
		<description>Doesn't this method prevent automated building with MSBuild as it needs VS to be running to function? is there a work around?</description>
		<content:encoded><![CDATA[<p>Doesn&#8217;t this method prevent automated building with MSBuild as it needs VS to be running to function? is there a work around?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-2649</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Sun, 27 Dec 2009 21:26:36 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-2649</guid>
		<description>Brandon, GetEnum method is defined in the code generation template itself.</description>
		<content:encoded><![CDATA[<p>Brandon, GetEnum method is defined in the code generation template itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-2571</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Sat, 19 Dec 2009 14:31:57 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-2571</guid>
		<description>What namespace is GetEnum() in? I can't seem to find it either in EnvDTE or google</description>
		<content:encoded><![CDATA[<p>What namespace is GetEnum() in? I can&#8217;t seem to find it either in EnvDTE or google</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-1530</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 23 Jun 2009 20:16:45 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-1530</guid>
		<description>I've done something similar to this - I got around the DB project problem by adding my table definition (id &#38; name) to the DB project, and using the generated SQL (re)populate it with the correct data.

The generated SQL can then be included in a DB project's post deployment script using something like

:r "..\ProjectWithT4\GeneratedEnums.sql"

I'm also using T4 to generate both my SQL and enum definition (.NET) code. With your method, I believe the SQL is not regenerated unless the template file is touched - this way a change causes both to be regenerated.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve done something similar to this - I got around the DB project problem by adding my table definition (id &amp; name) to the DB project, and using the generated SQL (re)populate it with the correct data.</p>
<p>The generated SQL can then be included in a DB project&#8217;s post deployment script using something like</p>
<p>:r &#8220;..\ProjectWithT4\GeneratedEnums.sql&#8221;</p>
<p>I&#8217;m also using T4 to generate both my SQL and enum definition (.NET) code. With your method, I believe the SQL is not regenerated unless the template file is touched - this way a change causes both to be regenerated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Bouch</title>
		<link>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-1037</link>
		<dc:creator>Anthony Bouch</dc:creator>
		<pubDate>Tue, 27 Jan 2009 00:43:59 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/#comment-1037</guid>
		<description>Would be great to have a template that creates an SQL view from the descriptor pattern as well as an enumeration.

http://www.devx.com/enterprise/Article/28246/0/page/3

http://www.58bits.com/blog/2008/06/30/AUIAndCultureFriendlyReplacementForEnumerationTypes.aspx</description>
		<content:encoded><![CDATA[<p>Would be great to have a template that creates an SQL view from the descriptor pattern as well as an enumeration.</p>
<p><a href="http://www.devx.com/enterprise/Article/28246/0/page/3" rel="nofollow">http://www.devx.com/enterprise/Article/28246/0/page/3</a></p>
<p><a href="http://www.58bits.com/blog/2008/06/30/AUIAndCultureFriendlyReplacementForEnumerationTypes.aspx" rel="nofollow">http://www.58bits.com/blog/2008/06/30/AUIAndCultureFriendlyReplacementForEnumerationTypes.aspx</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

