<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>michael pardo &#187; SubSonic</title>
	<atom:link href="http://michaelpardo.com/category/development/net/subsonic/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelpardo.com</link>
	<description>software developer</description>
	<lastBuildDate>Fri, 14 May 2010 13:21:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=9426</generator>
		<item>
		<title>SubSonic condition expressions</title>
		<link>http://michaelpardo.com/2009/07/subsonic-condition-expressions/</link>
		<comments>http://michaelpardo.com/2009/07/subsonic-condition-expressions/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 19:07:33 +0000</pubDate>
		<dc:creator>Michael Pardo</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SubSonic]]></category>

		<guid isPermaLink="false">http://michaelpardo.com/?p=256</guid>
		<description><![CDATA[Let&#8217;s say I have a table called &#8220;Contacts&#8221;. I&#8217;d like to search that table for the string &#8220;michael pardo&#8221;, however, I could pass in the string &#8220;pardo michael&#8221; instead. I&#8217;d like it to work either way, so here&#8217;s what I think the query should look like: 1 2 3 4 5 6 7 8 9 [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say I have a table called <strong>&#8220;Contacts&#8221;</strong>. I&#8217;d like to search that table for the string <strong>&#8220;michael pardo&#8221;</strong>, however, I could pass in the string <strong>&#8220;pardo michael&#8221;</strong> instead. I&#8217;d like it to work either way, so here&#8217;s what I think the query should look like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> 
<span style="color: #993333; font-weight: bold;">FROM</span> Contacts
<span style="color: #993333; font-weight: bold;">WHERE</span> 
<span style="color: #66cc66;">&#40;</span>
    FirstName <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%michael%'</span> 
    <span style="color: #993333; font-weight: bold;">OR</span> LastName <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%michael%'</span>
<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">AND</span> 
<span style="color: #66cc66;">&#40;</span>
    FirstName <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%pardo%'</span> 
    <span style="color: #993333; font-weight: bold;">OR</span> LastName <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%pardo%'</span>
<span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Okay, well how do I enclose those condition expressions with SubSonic? We can take advantage of the <strong>Expression</strong> syntax to make this work. Here&#8217;s the SubSonic code, broken up by query parts.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// SELECT * FROM Contacts</span>
var q <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Select<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">From</span><span style="color: #008000;">&lt;</span>Contact<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// WHERE (FirstName LIKE '%michael%' OR LastName LIKE '%michael%')</span>
q.<span style="color: #0000FF;">WhereExpression</span><span style="color: #000000;">&#40;</span>Contact.<span style="color: #0000FF;">Columns</span>.<span style="color: #0000FF;">FirstName</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Like</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%michael%&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
q.<span style="color: #0000FF;">Or</span><span style="color: #000000;">&#40;</span>Contact.<span style="color: #0000FF;">Columns</span>.<span style="color: #0000FF;">LastName</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Like</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%michael%&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// AND (FirstName LIKE '%pardo%' OR LastName LIKE '%pardo%')</span>
q.<span style="color: #0000FF;">AndExpression</span><span style="color: #000000;">&#40;</span>Contact.<span style="color: #0000FF;">Columns</span>.<span style="color: #0000FF;">FirstName</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Like</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%pardo%&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
q.<span style="color: #0000FF;">Or</span><span style="color: #000000;">&#40;</span>Contact.<span style="color: #0000FF;">Columns</span>.<span style="color: #0000FF;">LastName</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Like</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%pardo%&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
q.<span style="color: #0000FF;">ExecuteTypedList</span><span style="color: #008000;">&lt;</span>Contact<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>One problem I encountered with this method was with chaining. If I chain the <strong>&#8220;or&#8221;</strong> commands instead of calling them separately, SubSonic will short-change you on the constraints it passes in. Some sort of bug (or feature) maybe.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelpardo.com/2009/07/subsonic-condition-expressions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Initializing SubSonic in your DNN module</title>
		<link>http://michaelpardo.com/2009/06/initializing-subsonic-in-your-dnn-module/</link>
		<comments>http://michaelpardo.com/2009/06/initializing-subsonic-in-your-dnn-module/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 13:57:18 +0000</pubDate>
		<dc:creator>Michael Pardo</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DotNetNuke]]></category>
		<category><![CDATA[SubSonic]]></category>

		<guid isPermaLink="false">http://michaelpardo.com/?p=85</guid>
		<description><![CDATA[SubSonic requires you to put some stuff in the web.config. You may be wondering how you&#8217;re going to distribute your module without requiring the buyer to alter his web.config. Here&#8217;s the method that I use: 1 2 3 4 5 6 7 8 9 10 11 12 private static void InitializeProvider&#40;&#41; &#123; DataService.Provider = new [...]]]></description>
			<content:encoded><![CDATA[<p>SubSonic requires you to put some stuff in the web.config. You may be wondering how you&#8217;re going to distribute your module without requiring the buyer to alter his web.config. Here&#8217;s the method that I use:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> InitializeProvider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    DataService.<span style="color: #0000FF;">Provider</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> SqlDataProvider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    DataService.<span style="color: #0000FF;">Providers</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> DataProviderCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    DataProvider provider <span style="color: #008000;">=</span> DataService.<span style="color: #0000FF;">Provider</span><span style="color: #008000;">;</span>
    var config <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> NameValueCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    config.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;SubSonicSqlString&quot;</span>, ConfigurationManager.<span style="color: #0000FF;">ConnectionStrings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;SiteSqlServer&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ConnectionString</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    provider.<span style="color: #0000FF;">Initialize</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;SubSonicSqlString&quot;</span>, config<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    DataService.<span style="color: #0000FF;">Provider</span>.<span style="color: #0000FF;">DefaultConnectionString</span> <span style="color: #008000;">=</span> ConfigurationManager.<span style="color: #0000FF;">ConnectionStrings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;SiteSqlServer&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ConnectionString</span><span style="color: #008000;">;</span>
    DataService.<span style="color: #0000FF;">Provider</span>.<span style="color: #0000FF;">GeneratedNamespace</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Example.DataModel&quot;</span><span style="color: #008000;">;</span>
    DataService.<span style="color: #0000FF;">Providers</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>provider<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>This method goes into my <strong>Page_Init</strong> event. Luckily I setup my module pages to inherit a base class that does all my setup. Here&#8217;s the base class:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections.Specialized</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Configuration</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.UI.HtmlControls</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">DotNetNuke.Entities.Modules</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">SubSonic</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">namespace</span> Example.<span style="color: #0000FF;">Common</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> ModuleBase <span style="color: #008000;">:</span> PortalModuleBase
    <span style="color: #000000;">&#123;</span>
        <span style="color: #008080;">#region Events</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> Page_Init<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">Object</span> sender, EventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            InitializeProvider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080;">#endregion</span>
&nbsp;
        <span style="color: #008080;">#region Methods</span>
&nbsp;
        <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> InitializeProvider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            DataService.<span style="color: #0000FF;">Provider</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> SqlDataProvider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            DataService.<span style="color: #0000FF;">Providers</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> DataProviderCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            DataProvider provider <span style="color: #008000;">=</span> DataService.<span style="color: #0000FF;">Provider</span><span style="color: #008000;">;</span>
            var config <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> NameValueCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            config.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;SubSonicSqlString&quot;</span>, ConfigurationManager.<span style="color: #0000FF;">ConnectionStrings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;SiteSqlServer&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ConnectionString</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            provider.<span style="color: #0000FF;">Initialize</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;SubSonicSqlString&quot;</span>, config<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            DataService.<span style="color: #0000FF;">Provider</span>.<span style="color: #0000FF;">DefaultConnectionString</span> <span style="color: #008000;">=</span> ConfigurationManager.<span style="color: #0000FF;">ConnectionStrings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;SiteSqlServer&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ConnectionString</span><span style="color: #008000;">;</span>
            DataService.<span style="color: #0000FF;">Provider</span>.<span style="color: #0000FF;">GeneratedNamespace</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Example.DataModel&quot;</span><span style="color: #008000;">;</span>
            DataService.<span style="color: #0000FF;">Providers</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>provider<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> RegisterJavascript<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> fullPath<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            var script <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> HtmlGenericControl<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;script&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            script.<span style="color: #0000FF;">Attributes</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;type&quot;</span>, <span style="color: #666666;">&quot;text/javascript&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            script.<span style="color: #0000FF;">Attributes</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;src&quot;</span>, fullPath<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Page.<span style="color: #0000FF;">Header</span>.<span style="color: #0000FF;">Controls</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>script<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080;">#endregion</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>In my last post about including jQuery properly I introduced the <strong>RegisterJavascript</strong> method. We can put the method in this class so we can use it in all pages inheriting the class.</p>
<p>One thing worth mentioning is that the app.config for SubSonic must be setup before you can expect this to work. You should also have a SubSonic data model built and referenced. You can learn more about that here: <a title="Setting up SubSonic in you DNN module Solution" href="http://michaelpardo.com/2009/06/setting-up-subsonic-in-you-dnn-module-solution/">http://michaelpardo.com/2009/06/setting-up-subsonic-in-you-dnn-module-solution/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelpardo.com/2009/06/initializing-subsonic-in-your-dnn-module/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up SubSonic in your DNN module Solution</title>
		<link>http://michaelpardo.com/2009/06/setting-up-subsonic-in-your-dnn-module-solution/</link>
		<comments>http://michaelpardo.com/2009/06/setting-up-subsonic-in-your-dnn-module-solution/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 13:51:22 +0000</pubDate>
		<dc:creator>Michael Pardo</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DotNetNuke]]></category>
		<category><![CDATA[SubSonic]]></category>

		<guid isPermaLink="false">http://michaelpardo.com/?p=117</guid>
		<description><![CDATA[In my modules I generally have three different projects. One for SubSonic, one for common stuff, and one for the module itself. The first thing I do when setting up a module is add a project for SubSonic. Let&#8217;s add a &#8220;Class Library&#8221; and call it &#8220;DataModel&#8221;. I&#8217;ll get to the setup of the other [...]]]></description>
			<content:encoded><![CDATA[<p>In my modules I generally have three different projects. One for SubSonic, one for common stuff, and one for the module itself. The first thing I do when setting up a module is add a project for SubSonic. Let&#8217;s add a <strong>&#8220;Class Library&#8221;</strong> and call it <strong>&#8220;DataModel&#8221;</strong>.</p>
<div id="attachment_119" class="wp-caption alignnone" style="width: 310px"><a href="http://michaelpardo.com/wp-content/uploads/2009/06/Picture-12.png" rel="lightbox[117]"><img class="size-medium wp-image-119" title="Add New Project" src="http://michaelpardo.com/wp-content/uploads/2009/06/Picture-12-300x213.png" alt="Add New Project" width="300" height="213" /></a><p class="wp-caption-text">Add New Project</p></div>
<p>I&#8217;ll get to the setup of the other projects in another post. Let&#8217;s just worry about SubSonic for right now as it is probably the easiest project to setup.</p>
<p>Now that we have the project added let&#8217;s add our app config. From the <strong>&#8220;Project&#8221;</strong> menu click <strong>&#8220;Add New Item&#8230;&#8221;</strong>. Select <strong>&#8220;Application Configuration File&#8221;</strong> and add it to your project.</p>
<div id="attachment_122" class="wp-caption alignnone" style="width: 310px"><a href="http://michaelpardo.com/wp-content/uploads/2009/06/Picture-2.png" rel="lightbox[117]"><img class="size-medium wp-image-122" title="Add New Item" src="http://michaelpardo.com/wp-content/uploads/2009/06/Picture-2-300x180.png" alt="Add New Item" width="300" height="180" /></a><p class="wp-caption-text">Add New Item</p></div>
<p>Here is the blank app.config file that I use to get started. You will need to alter some of the settings to fit your project.</p>
<p>You can find more information on setting up the app.config here: <a title="SubSonic getting started" href="http://subsonicproject.com/setup/gettingstarted/">http://subsonicproject.com/setup/gettingstarted/</a></p>
<p>After you have done the initial setup you will be able to generate your classes. If you haven&#8217;t already setup SubSonic in Visual Studio you can learn how here: <a href="http://michaelpardo.com/2009/06/visuals-studio-and-subsonic/">http://michaelpardo.com/2009/06/visuals-studio-and-subsonic/</a></p>
<p>Click <strong>&#8220;Tools&#8221;</strong> and then <strong>&#8220;SubSonic&#8221;</strong> to generate the classes. You will not see the files in the <strong>Solution Explorer</strong> until you click <strong>&#8220;Show All Files&#8221;</strong> and <strong>&#8220;Refresh&#8221;</strong>. If you have done all these steps properly you will see a <strong>&#8220;Generated&#8221;</strong> folder in your project. Add the folder and build.</p>
<p>You&#8217;re done! Now you can reference this project in your module.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelpardo.com/2009/06/setting-up-subsonic-in-your-dnn-module-solution/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Visual Studio and SubSonic</title>
		<link>http://michaelpardo.com/2009/06/visuals-studio-and-subsonic/</link>
		<comments>http://michaelpardo.com/2009/06/visuals-studio-and-subsonic/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 13:15:13 +0000</pubDate>
		<dc:creator>Michael Pardo</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SubSonic]]></category>

		<guid isPermaLink="false">http://www.michaelpardo.com/?p=45</guid>
		<description><![CDATA[If you aren&#8217;t using SubSonic yet, you should be. You can find out more at subsonicproject.com. Here&#8217;s the easiest way to get SubSonic working smoothly from within Visual Studio. Download the SubSonic source from http://subsonicproject.googlecode.com/files/SubSonic_2.1_Final_Source.zip and extract it. I chose to create a folder for SubSonic in &#8220;C:\Program Files\&#8221;. Next, in Visual Studio click the [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren&#8217;t using SubSonic yet, you should be. You can find out more at <a href="http://subsonicproject.com/">subsonicproject.com</a>. Here&#8217;s the easiest way to get SubSonic working smoothly from within Visual Studio.</p>
<p>Download the SubSonic source from <a href="http://subsonicproject.googlecode.com/files/SubSonic_2.1_Final_Source.zip">http://subsonicproject.googlecode.com/files/SubSonic_2.1_Final_Source.zip</a> and extract it. I chose to create a folder for SubSonic in <strong>&#8220;C:\Program Files\&#8221;</strong>.</p>
<div id="attachment_46" class="wp-caption alignnone" style="width: 310px"><a href="http://www.michaelpardo.com/wp-content/uploads/2009/06/Picture-1.png" rel="lightbox[45]"><img class="size-medium wp-image-46" title="SubSonic Folder" src="http://www.michaelpardo.com/wp-content/uploads/2009/06/Picture-1-300x231.png" alt="SubSonic Folder" width="300" height="231" /></a><p class="wp-caption-text">SubSonic Folder</p></div>
<p>Next, in Visual Studio click the <strong>&#8220;External Tools&#8230;&#8221;</strong> menu item from the <strong>&#8220;Tools&#8221;</strong> menu. A dialog box will pop up allowing you to manage the external tools. Click <strong>&#8220;Add&#8221;</strong> and enter the following:</p>
<div id="attachment_49" class="wp-caption alignnone" style="width: 310px"><a href="http://www.michaelpardo.com/wp-content/uploads/2009/06/Picture-4.png" rel="lightbox[45]"><img class="size-medium wp-image-49" title="External Tools Dialog" src="http://www.michaelpardo.com/wp-content/uploads/2009/06/Picture-4-300x292.png" alt="External Tools Dialog" width="300" height="292" /></a><p class="wp-caption-text">External Tools Dialog</p></div>
<p><strong>Title: </strong>SubSonic (or whatever you want really)<br />
<strong>Command:</strong> C:\YOUR_SUBSONIC_PATH\SubSonic2.2\SubCommander\sonic.exe<br />
<strong>Arguments:</strong> generate /out $(ProjectDir)/Generated<br />
<strong>Initial directory:</strong> $(ProjectDir)</p>
<p>I check <strong>&#8220;User Output window&#8221;</strong>. If you don&#8217;t a console window will popup every time you run the command.</p>
<p>Now you will have a <strong>&#8220;SubSonic&#8221; </strong>menu item in your <strong>&#8220;Tools&#8221;</strong> menu which will generate all your subsonic classes.</p>
<div id="attachment_54" class="wp-caption alignnone" style="width: 199px"><a href="http://www.michaelpardo.com/wp-content/uploads/2009/06/Picture-11.png" rel="lightbox[45]"><img class="size-medium wp-image-54" title="Tools Menu" src="http://www.michaelpardo.com/wp-content/uploads/2009/06/Picture-11-189x300.png" alt="Tools Menu" width="189" height="300" /></a><p class="wp-caption-text">Tools Menu</p></div>
<p>Of course, you need to have your app.config/web.config setup with SubSonic for the classes to generate. You can find more information about doing that here: <a title="Getting started with SubSonic" href="http://subsonicproject.com/setup/gettingstarted/">http://subsonicproject.com/setup/gettingstarted/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelpardo.com/2009/06/visuals-studio-and-subsonic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
