<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>The Mostly Clean Coder</title>
    <description>An occassionally dirty exploration in .Net development</description>
    <link>http://www.mostlyclean.com/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.Net Syndication Generator 1.0.0.0 (http://dotnetblogengine.net/)</generator>
    <language>en-GB</language>
    <blogChannel:blogRoll>http://www.mostlyclean.com/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>The Mostly Clean Coder</dc:creator>
    <dc:title>The Mostly Clean Coder</dc:title>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/TheMostlyCleanCoder" type="application/rss+xml" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheMostlyCleanCoder" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheMostlyCleanCoder" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheMostlyCleanCoder" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/TheMostlyCleanCoder" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheMostlyCleanCoder" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FTheMostlyCleanCoder" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheMostlyCleanCoder" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FTheMostlyCleanCoder" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Brisbane Alt.Net meeting 4</title>
      <description>&lt;p&gt;
It is time again next Thursday (May 7) for the Alt.Net meeting here in Brisbane. For all of the details please head to the EventBrite registration page - &lt;a href="http://altnetbrisbane.eventbrite.com/"&gt;http://altnetbrisbane.eventbrite.com/&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
This month we are looking to have a CodingDojo, which will be a great opportunity to put some of the theory into practice. It should be interesting. 
&lt;/p&gt;
&lt;p&gt;
Remember that the meeting is held on the first Thursday every month. Tell your friends.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/PF2PjX8w-RE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/PF2PjX8w-RE/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2009/04/Brisbane-AltNet-meeting-4.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=d9f24300-d6a4-4d97-b445-4dcbce6c9f88</guid>
      <pubDate>Tue, 28 Apr 2009 07:30:00 +1000</pubDate>
      <category>ALT.NET</category>
      <category>CastleActiveRecord</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=d9f24300-d6a4-4d97-b445-4dcbce6c9f88</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=d9f24300-d6a4-4d97-b445-4dcbce6c9f88</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2009/04/Brisbane-AltNet-meeting-4.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=d9f24300-d6a4-4d97-b445-4dcbce6c9f88</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=d9f24300-d6a4-4d97-b445-4dcbce6c9f88</feedburner:origLink></item>
    <item>
      <title>TeamCity Command Line Runner parameters</title>
      <description>&lt;p&gt;When using TeamCity as my CI server, my personal preference is to use the Command Line runner. I feel that this gives me the ultimate flexibility, as it is easy to pass parameters to a batch file, and the batch file can in turn be invoked to run a Nant script. It also ensures that my local build experience is as close as possible to what is happening on the build server.&lt;/p&gt;  &lt;p&gt;What can I say? I am a control freak when it comes to this stuff.&lt;/p&gt;  &lt;p&gt;Recently I was setting up a new build configuration and was having trouble passing in TeamCity environment variables. I tries a stack of variations on the theme but couldn’t seem to crack the right syntax. So here preserved in all its glory is the correct way to pass the environment variables to the command line.&lt;/p&gt;  &lt;h3&gt;1. Select ‘Add New Variable’ under Environment Variables in your build configuration&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.mostlyclean.com/image.axd?picture=WindowsLiveWriter/TeamCityCommandLineRunnerparameters/4447C0AC/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mostlyclean.com/image.axd?picture=WindowsLiveWriter/TeamCityCommandLineRunnerparameters/142075E9/image_thumb.png" width="743" height="271" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;2. Define your variable name and value&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.mostlyclean.com/image.axd?picture=WindowsLiveWriter/TeamCityCommandLineRunnerparameters/2EEC9BF5/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mostlyclean.com/image.axd?picture=WindowsLiveWriter/TeamCityCommandLineRunnerparameters/715F3E2B/image_thumb.png" width="360" height="114" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When saved the variable will be renamed slightly and will appear like…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.mostlyclean.com/image.axd?picture=WindowsLiveWriter/TeamCityCommandLineRunnerparameters/30BCF1BC/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mostlyclean.com/image.axd?picture=WindowsLiveWriter/TeamCityCommandLineRunnerparameters/607A9A3B/image_thumb.png" width="737" height="270" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;3. Add the syntactically correct reference to your command line parameters &lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.mostlyclean.com/image.axd?picture=WindowsLiveWriter/TeamCityCommandLineRunnerparameters/370658FB/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mostlyclean.com/image.axd?picture=WindowsLiveWriter/TeamCityCommandLineRunnerparameters/4DC83135/image_thumb.png" width="737" height="274" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The trick is to include the &lt;strong&gt;&lt;em&gt;'%'&lt;/em&gt;&lt;/strong&gt; symbol markers and also the &lt;strong&gt;&lt;em&gt;'env.'&lt;/em&gt;&lt;/strong&gt; prefix on the name that you defined.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/_szYaBVgEM4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/_szYaBVgEM4/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2009/04/TeamCity-Command-Line-Runner-parameters.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=803dc454-e93b-4123-9703-e9f8ae25cfc5</guid>
      <pubDate>Thu, 16 Apr 2009 07:06:31 +1000</pubDate>
      <category>.NET</category>
      <category>TeamCity</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=803dc454-e93b-4123-9703-e9f8ae25cfc5</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=803dc454-e93b-4123-9703-e9f8ae25cfc5</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2009/04/TeamCity-Command-Line-Runner-parameters.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=803dc454-e93b-4123-9703-e9f8ae25cfc5</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=803dc454-e93b-4123-9703-e9f8ae25cfc5</feedburner:origLink></item>
    <item>
      <title>Brisbane Alt .Net 2</title>
      <description>&lt;p&gt;This Thursday is the second meeting for Brisbane Alt.Net. Heinrich has created an EventBrite registration form so that we can better handle RSVP’s and it would be great if everyone coming could take the time to quickly supply your details.&lt;/p&gt;  &lt;p&gt;Go to &lt;a title="http://brisbanealtnet.eventbrite.com/" href="http://brisbanealtnet.eventbrite.com/"&gt;http://brisbanealtnet.eventbrite.com/&lt;/a&gt; to view the event details and register your RSVP.&lt;/p&gt;  &lt;p&gt;I hope to see everyone there again, and hopefully some new faces as well.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/s3ZxTBCbBRg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/s3ZxTBCbBRg/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2009/03/Brisbane-Alt-Net-2.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=ee67cbd5-c292-450b-a792-7ff442d48ecd</guid>
      <pubDate>Tue, 03 Mar 2009 10:27:41 +1000</pubDate>
      <category>brisalt.net</category>
      <category>ALT.NET</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=ee67cbd5-c292-450b-a792-7ff442d48ecd</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=ee67cbd5-c292-450b-a792-7ff442d48ecd</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2009/03/Brisbane-Alt-Net-2.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=ee67cbd5-c292-450b-a792-7ff442d48ecd</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=ee67cbd5-c292-450b-a792-7ff442d48ecd</feedburner:origLink></item>
    <item>
      <title>Wise words on developing junior developers</title>
      <description>&lt;p&gt;I was hanging out at &lt;a href="http://www.infoq.com"&gt;InfoQ.com&lt;/a&gt; watching some videos about software development. You know – honing my craft. If you want to call it that. Anyway, a highly recommended way to spend your weekends :)&lt;/p&gt;  &lt;p&gt;Something struck me as inspired, particularly in relation to a discussion we touched on at the Brisbane Alt.Net meeting around ensuring software quality. It is somewhat loosely related and it relies on analogy, but below is a response by Greg Young to a question regarding his strategy for training junior developers.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;I have always believed that the only way to bring up junior developers in any technology - it doesn't matter what it is - is an apprenticeship program. You bring them up from apprentices and they move on, they pair a lot, they get code reviewed a lot, they are put on fake work, just like a real apprentice. &lt;/p&gt;    &lt;p&gt;You want to learn how to make tables? Well, you are going to make a lot of tables. Not all of them are going to end up being sold. Sometimes you'll make a leg of a table just for the sake of making a leg on a table. Over time, they will build up the skills and the main way of how to build a lot of skills is by being in other people's code, who did know what they were doing and they will start seeing the good habits of those around them. The place where it fails and it fails all the way back to the pre-industrial age era is when you don't actually have somebody who is a master of their crafts, teaching apprentices.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I thought it was brilliant (as was a lot of stuff in the &lt;a href="http://www.infoq.com/interviews/greg-young-ddd"&gt;interview&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;And while you are at InfoQ, be sure to check out &lt;a href="http://www.infoq.com/presentations/katz-couchdb-and-me"&gt;Damien Katz’s talk&lt;/a&gt; about the personal inspirations and challenges about going it alone on his solo project &lt;a href="http://couchdb.apache.org/"&gt;CouchDB&lt;/a&gt;. It is a very honest and revealing presentation.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/auvzR7hX_9M" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/auvzR7hX_9M/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2009/02/Wise-words-on-developing-junior-developers.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=cc9a8bc9-bfc0-46ac-a97f-2b12dbcb2fcc</guid>
      <pubDate>Sun, 08 Feb 2009 12:56:00 +1000</pubDate>
      <category>Development Philosophy</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=cc9a8bc9-bfc0-46ac-a97f-2b12dbcb2fcc</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=cc9a8bc9-bfc0-46ac-a97f-2b12dbcb2fcc</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2009/02/Wise-words-on-developing-junior-developers.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=cc9a8bc9-bfc0-46ac-a97f-2b12dbcb2fcc</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=cc9a8bc9-bfc0-46ac-a97f-2b12dbcb2fcc</feedburner:origLink></item>
    <item>
      <title>Brisbane's First Alt.Net Meeting</title>
      <description>&lt;p&gt;
I have been following the &lt;a href="http://altdotnet.org/" title="http://altdotnet.org/"&gt;Alt.Net&lt;/a&gt; &lt;a href="http://tech.groups.yahoo.com/group/altdotnet/" title="http://tech.groups.yahoo.com/group/altdotnet/"&gt;mailing list&lt;/a&gt; since before it was even called that (remember &amp;#39;cli_dev&amp;#39; anyone?). It has been of undoubted assitance to my career and in the interests of &amp;#39;sharing the love&amp;#39;,&amp;nbsp;a movement has been made towards building a local meetup group. 
&lt;/p&gt;
&lt;p&gt;
Heinrich (a former colleague of mine at Hyro) has done most of the work and now dates have been set and venues booked. Below are the details for the inaugural Brisbane Alt.Net meeting: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Date &lt;/strong&gt;: Thursday, February 5 &lt;br /&gt;
&lt;strong&gt;Time &lt;/strong&gt;: 5:30pm for 6:00pm start &lt;br /&gt;
&lt;strong&gt;Address &lt;/strong&gt;: Hyro offices - Level 1, 500 Brunswick St, Fortitude Valley (it&amp;nbsp;is upstairs in&amp;nbsp;the Timber Queensland building) &lt;br /&gt;
&lt;em&gt;Some food and drinks provided&lt;/em&gt; 
&lt;/p&gt;
&lt;p&gt;
An RSVP would be appreciated so we know that the room and catering are sufficient. It is enough to leave a comment here as an RSVP and I can pass it on in an official capacity. I hope to see all you locals there. 
&lt;/p&gt;
&lt;iframe src="http://maps.google.com.au/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=hyro+brisbane&amp;amp;sll=-25.335448,135.745076&amp;amp;sspn=52.87444,114.257813&amp;amp;ie=UTF8&amp;amp;cid=-27461039,153038198,7100706807520522370&amp;amp;s=AARTsJpfMLSFuJi29dJrY3TsBsvGKctGMQ&amp;amp;ll=-27.457959,153.03925&amp;amp;spn=0.00952,0.010729&amp;amp;z=16&amp;amp;iwloc=A&amp;amp;output=embed" width="500" height="500" frameborder="0"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;a style="color: #0000ff; text-align: left" href="http://maps.google.com.au/maps?f=q&amp;amp;source=embed&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=hyro+brisbane&amp;amp;sll=-25.335448,135.745076&amp;amp;sspn=52.87444,114.257813&amp;amp;ie=UTF8&amp;amp;cid=-27461039,153038198,7100706807520522370&amp;amp;ll=-27.457959,153.03925&amp;amp;spn=0.00952,0.010729&amp;amp;z=16&amp;amp;iwloc=A"&gt;View Larger Map&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/lZAWJGE0y5I" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/lZAWJGE0y5I/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2009/01/Brisbanes-First-AltNet-Meeting.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=7a26d034-d1c6-490e-9ce4-e9fde38f55aa</guid>
      <pubDate>Thu, 22 Jan 2009 11:51:00 +1000</pubDate>
      <category>brisalt.net</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=7a26d034-d1c6-490e-9ce4-e9fde38f55aa</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=7a26d034-d1c6-490e-9ce4-e9fde38f55aa</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2009/01/Brisbanes-First-AltNet-Meeting.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=7a26d034-d1c6-490e-9ce4-e9fde38f55aa</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=7a26d034-d1c6-490e-9ce4-e9fde38f55aa</feedburner:origLink></item>
    <item>
      <title>RPXLib 0.0.2 released</title>
      <description>&lt;p&gt;
For those playing along at home I have built a 0.0.2 release for RPXLib. The only change is a small (but significant) bugfix around a misspelt property name.
&lt;/p&gt;
&lt;p&gt;
Thanks to &lt;a href="http://blechie.com/wtilton/Default.aspx"&gt;Willie Tilton&lt;/a&gt; for noticing the problem. The release can be found &lt;a href="http://rpxlib.googlecode.com/files/RPXLib-Release-0.0.2.zip"&gt;here&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
Don&amp;#39;t forget to check out the &lt;a href="http://code.google.com/p/rpxlib/"&gt;project home page&lt;/a&gt; at google code.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/OMj7BuycflI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/OMj7BuycflI/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2009/01/RPXLib-002-released.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=76d0aaa6-0f5e-4969-ac3e-781fcdfb1fdb</guid>
      <pubDate>Fri, 02 Jan 2009 11:26:00 +1000</pubDate>
      <category>RPXLib</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=76d0aaa6-0f5e-4969-ac3e-781fcdfb1fdb</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=76d0aaa6-0f5e-4969-ac3e-781fcdfb1fdb</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2009/01/RPXLib-002-released.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=76d0aaa6-0f5e-4969-ac3e-781fcdfb1fdb</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=76d0aaa6-0f5e-4969-ac3e-781fcdfb1fdb</feedburner:origLink></item>
    <item>
      <title>Announcing RPXLib for .Net</title>
      <description>&lt;p&gt;
I have long been convinced of the worth of &lt;a href="http://openid.net/what/"&gt;OpenId&lt;/a&gt;. I am unsure if it is the ultimate solution - but for now it is definitely the best solution we have (imho). When I heard about &lt;a href="https://rpxnow.com/"&gt;RPX&lt;/a&gt;, a new integration service from &lt;a href="http://www.janrain.com/"&gt;JanRain&lt;/a&gt;, my interest sky-rocketed. Previously, the thought of manually integrating into the current OpenId world seemed intimidating to me. RPX solves that problem - hands down.
&lt;/p&gt;
&lt;p&gt;
And what does a developer do when confronted by an open &lt;a href="https://rpxnow.com/docs"&gt;API&lt;/a&gt;? He writes a custom wrapper in his language of choice - that&amp;#39;s what he does.
&lt;/p&gt;
&lt;p&gt;
So this post announces &lt;a href="http://code.google.com/p/rpxlib/"&gt;RPXLib&lt;/a&gt;, now available on Google Code. It is a .Net wrapper meant to take some of the pain out of RPX integration by handling most of the boring stuff for you. It presents a simplified service API and returns strongly-typed response objects for you to play with. Be sure to take a peek at the &lt;a href="http://code.google.com/p/rpxlib/w/list"&gt;documentation wiki&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
It is worth noting that this works well on my machine - but I am very interested to hear from others about the benefit that this provides (or lack of benefits, even more importantly). I figure it takes about 2-3 minutes to read the doco and about another 10 minutes to integrate this into your application. Your mileage may vary and I would love to hear your experiences. 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/Y6Td5Z1Ln7E" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/Y6Td5Z1Ln7E/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/11/Announcing-RPXLib-for-Net.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=dce40509-20b3-46e0-b4b9-b9c9d74b0b09</guid>
      <pubDate>Mon, 24 Nov 2008 15:18:00 +1000</pubDate>
      <category>.NET</category>
      <category>Development Philosophy</category>
      <category>RPXLib</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=dce40509-20b3-46e0-b4b9-b9c9d74b0b09</pingback:target>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=dce40509-20b3-46e0-b4b9-b9c9d74b0b09</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/11/Announcing-RPXLib-for-Net.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=dce40509-20b3-46e0-b4b9-b9c9d74b0b09</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=dce40509-20b3-46e0-b4b9-b9c9d74b0b09</feedburner:origLink></item>
    <item>
      <title>Hitting the open market</title>
      <description>&lt;p&gt;
As I approach the end of my current contract it appears less and less likley that funding will be available for my renewal. A shame really considering the progress we have made on the new version of the application - which has manifested into a pretty damn nice codebase, even if I do say so myself. But unfortunately administrivia is once again about to become the downfall of a potentially promising project.
&lt;/p&gt;
&lt;p&gt;
So with that news I announce myself available. I am a little shaken by this news but I am positive that some good will come of it. If anyone knows of any suitable local or telecommutable work - please keep me in my mind.
&lt;/p&gt;
&lt;p&gt;
I have uploaded my current CV to my &lt;a href="http://www.mostlyclean.com/page/About-Me.aspx"&gt;about page&lt;/a&gt;. 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/nkWOHwjpUJE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/nkWOHwjpUJE/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/11/Hitting-the-open-market.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=69041a1d-f689-4bf7-88d4-95c58d402bb0</guid>
      <pubDate>Wed, 19 Nov 2008 22:37:00 +1000</pubDate>
      <category>Personal</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=69041a1d-f689-4bf7-88d4-95c58d402bb0</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=69041a1d-f689-4bf7-88d4-95c58d402bb0</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/11/Hitting-the-open-market.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=69041a1d-f689-4bf7-88d4-95c58d402bb0</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=69041a1d-f689-4bf7-88d4-95c58d402bb0</feedburner:origLink></item>
    <item>
      <title>The inevitable tweet announcement</title>
      <description>&lt;p&gt;
For those who care to play along - I am now twittering. I don&amp;#39;t do it that often, but when I do - pure gold baby!
&lt;/p&gt;
&lt;p&gt;
Not really. 
&lt;/p&gt;
&lt;p&gt;
My username is &lt;em&gt;&lt;strong&gt;sburman&lt;/strong&gt;&lt;/em&gt;. Check me out here - &lt;a href="http://twitter.com/sburman"&gt;http://twitter.com/sburman&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/hZ8Lq2yqKXw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/hZ8Lq2yqKXw/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/11/The-inevitable-tweet-announcement.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=9eb32f6f-295c-4191-a3fe-60c18296e692</guid>
      <pubDate>Wed, 19 Nov 2008 21:57:00 +1000</pubDate>
      <category>Personal</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=9eb32f6f-295c-4191-a3fe-60c18296e692</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=9eb32f6f-295c-4191-a3fe-60c18296e692</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/11/The-inevitable-tweet-announcement.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=9eb32f6f-295c-4191-a3fe-60c18296e692</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=9eb32f6f-295c-4191-a3fe-60c18296e692</feedburner:origLink></item>
    <item>
      <title>ASP.Net MVC BeginForm - Beta API Change</title>
      <description>&lt;p&gt;
The refactoring of the helper method &lt;em&gt;Html.Form&lt;/em&gt; in MVC to &lt;em&gt;Html.BeginForm&lt;/em&gt; was published in the release notes as a simple renaming. During the beta upgrade process we noticed that a lot of our forms were rendering with blank actions.
&lt;/p&gt;
&lt;p&gt;
If you too are having trouble with your forms, it is worth noting that the API has changed in a subtle but &lt;strong&gt;EXTREMELY &lt;/strong&gt;significant way. The orignal method, whose signature looked like:
&lt;/p&gt;
&lt;div class="code"&gt;
public&amp;nbsp;static&amp;nbsp;IDisposable&amp;nbsp;Form(this&amp;nbsp;HtmlHelper&amp;nbsp;helper,&amp;nbsp;string&amp;nbsp;controllerName,&amp;nbsp;string&amp;nbsp;actionName)
&lt;/div&gt;
&lt;p&gt;
Has been changed to read:
&lt;/p&gt;
&lt;div class="code"&gt;
public&amp;nbsp;static&amp;nbsp;MvcForm&amp;nbsp;BeginForm(this&amp;nbsp;HtmlHelper&amp;nbsp;htmlHelper,&amp;nbsp;string&amp;nbsp;actionName,&amp;nbsp;string&amp;nbsp;controllerName)
&lt;/div&gt;
&lt;p&gt;
Note that &lt;strong&gt;the parameters have been interchanged!&lt;/strong&gt; So if you were using magic string-ness to get actions into your forms, you now have a bigger upgrade job than you thought. You will need to switch the parameter strings and put your controller where your action is - and vice versa.
&lt;/p&gt;
&lt;p&gt;
This was tracked down in my team by Simon Sanderson (who we are assured is unrelated to MVC guru &lt;a href="http://blog.codeville.net/"&gt;Steve&lt;/a&gt;). There is a confession of sorts from the MVC team &lt;a href="http://forums.asp.net/t/1335434.aspx"&gt;here&lt;/a&gt;.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/hMQ4q4EeRek" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/hMQ4q4EeRek/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/10/ASPNet-MVC-BeginForm---Beta-API-Change.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=d7f764ec-75d1-493b-8ba3-02fa1b23312b</guid>
      <pubDate>Thu, 30 Oct 2008 16:19:00 +1000</pubDate>
      <category>ASP.NET</category>
      <category>ASP.NET-MVC</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=d7f764ec-75d1-493b-8ba3-02fa1b23312b</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=d7f764ec-75d1-493b-8ba3-02fa1b23312b</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/10/ASPNet-MVC-BeginForm---Beta-API-Change.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=d7f764ec-75d1-493b-8ba3-02fa1b23312b</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=d7f764ec-75d1-493b-8ba3-02fa1b23312b</feedburner:origLink></item>
    <item>
      <title>Linq.Specifications - The Project</title>
      <description>&lt;p&gt;
In the past few weeks I have revisited the specification pattern using Linq. I have teased it, toyed with it and tricked it up. And today I announce the public availability of a project demonstrating my current thoughts. You can grab the solution from Google Code at &lt;a href="http://code.google.com/p/linq-specifications"&gt;http://code.google.com/p/linq-specifications&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I have no doubt that improvements can and will be made if this generates any wider adoption. For now, it suits what I am currently working on quite nicely. YMMV.
&lt;/p&gt;
&lt;p&gt;
Below is a class diagram of the current core of the project. Use it as a quick reference but be sure to check out the code for a more in-depth view.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.mostlyclean.com/image.axd?picture=Specifications.jpg" alt="" /&gt;
&lt;/p&gt;
&lt;p&gt;
Shortly I will do up a few examples on the project wiki that will flesh out some of the gotchas I have come across already and I need some more testing around some of the elements. For now, however, I just wanted to get this out in the wild. Feel free to comment/flame. I look forward to any feedback.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f10%2fLinq-Specifications-The-Project.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f10%2fLinq-Specifications-The-Project.aspx&amp;amp;bgcolor=444444&amp;amp;cbgcolor=BBBBBB" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/ZMgad3t_T80" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/ZMgad3t_T80/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/10/Linq-Specifications-The-Project.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=c21898c0-e19d-449e-a7c6-ece44556ff39</guid>
      <pubDate>Sat, 18 Oct 2008 10:25:00 +1000</pubDate>
      <category>.NET</category>
      <category>Linq</category>
      <category>NHibernate</category>
      <category>TDD</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=c21898c0-e19d-449e-a7c6-ece44556ff39</pingback:target>
      <slash:comments>9</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=c21898c0-e19d-449e-a7c6-ece44556ff39</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/10/Linq-Specifications-The-Project.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=c21898c0-e19d-449e-a7c6-ece44556ff39</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=c21898c0-e19d-449e-a7c6-ece44556ff39</feedburner:origLink></item>
    <item>
      <title>Basic NHibernate session management with Autofac</title>
      <description>&lt;p&gt;
Using the container scoping capablity of Autofac makes NHibernate session management a breeze. Obviously this only handles the most basic session-per-request scenario but we know that can cover a large percentage of most peoples requirements anyway. I am sure other containers could get to this functionality as well, but I was blown away by how easy it was aith Autofac. Below is my session management configuration:
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;builder.Register&lt;font color="blue"&gt;&amp;lt;&lt;/font&gt;&lt;font color="maroon"&gt;NHibernateInstance&lt;/font&gt;&lt;font color="blue"&gt;&amp;gt;&lt;/font&gt;&lt;font color="black"&gt;().SingletonScoped();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;builder.Register(c&amp;nbsp;=&amp;gt;&amp;nbsp;c.Resolve&lt;/font&gt;&lt;font color="blue"&gt;&amp;lt;&lt;/font&gt;&lt;font color="maroon"&gt;NHibernateInstance&lt;/font&gt;&lt;font color="blue"&gt;&amp;gt;&lt;/font&gt;&lt;font color="black"&gt;().CreateSession()).As&lt;/font&gt;&lt;font color="blue"&gt;&amp;lt;&lt;/font&gt;&lt;font color="maroon"&gt;ISession&lt;/font&gt;&lt;font color="blue"&gt;&amp;gt;&lt;/font&gt;&lt;font color="black"&gt;().ContainerScoped();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;builder.RegisterGeneric(typeof&amp;nbsp;(Repository&lt;/font&gt;&lt;font color="blue"&gt;&amp;lt;&lt;/font&gt;&lt;font color="maroon"&gt;&lt;/font&gt;&lt;font color="blue"&gt;&amp;gt;&lt;/font&gt;&lt;font color="black"&gt;)).As(typeof&amp;nbsp;(IRepository&lt;/font&gt;&lt;font color="blue"&gt;&amp;lt;&lt;/font&gt;&lt;font color="maroon"&gt;&lt;/font&gt;&lt;font color="blue"&gt;&amp;gt;&lt;/font&gt;&lt;font color="black"&gt;)).ContainerScoped();&lt;/font&gt;
&lt;/div&gt;
&lt;p&gt;
So the key points are:
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Plug in the Autofac HttpHandler for ASP.Net integration by following the instructions &lt;a href="http://code.google.com/p/autofac/wiki/AspNetIntegration" title="AspNetIntegration with Autofac"&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Have a singleton instance of the NHibernate session factory (housed in my NHibernateInstance class)&lt;/li&gt;
	&lt;li&gt;Have a method on that singleton registered instance that returns an ISession (CreateSession in my example)&lt;br /&gt;
	&lt;/li&gt;
	&lt;li&gt;Configure a container scoped instance of the NHibernate ISession, thus ensuring that the created instance will not cross request boundaries &lt;/li&gt;
	&lt;li&gt;Have the container dynamically inject the ISession into your IRepository implementation&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
For more information on container scoping in Autofac for ASP.Net web applications check out the Autofac &lt;a href="http://code.google.com/p/autofac/wiki/AspNetIntegration" title="AspNetIntegration in Autofac"&gt;wiki article&lt;/a&gt;.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/KDHx8MqL1n0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/KDHx8MqL1n0/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/08/Basic-NHibernate-session-management-with-Autofac.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=1f62ffca-7107-4d5b-b8ca-4ad20749e32e</guid>
      <pubDate>Tue, 19 Aug 2008 14:11:00 +1000</pubDate>
      <category>.NET</category>
      <category>Development</category>
      <category>NHibernate</category>
      <category>Autofac</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=1f62ffca-7107-4d5b-b8ca-4ad20749e32e</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=1f62ffca-7107-4d5b-b8ca-4ad20749e32e</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/08/Basic-NHibernate-session-management-with-Autofac.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=1f62ffca-7107-4d5b-b8ca-4ad20749e32e</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=1f62ffca-7107-4d5b-b8ca-4ad20749e32e</feedburner:origLink></item>
    <item>
      <title>Linq Expressions, The Specification Pattern and Repositories - Part 3</title>
      <description>&lt;p&gt;
In the previous to parts to this series (&lt;a href="http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-1.aspx" title="Part 1"&gt;here&lt;/a&gt; and &lt;a href="http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-2.aspx" title="Part 2"&gt;here&lt;/a&gt;) I showed the basic infrastructure framework for using Linq-based specifications with a flexible repository interface. In this article I dig deeper into the Expression based find functionality and it&amp;#39;s implementation.
&lt;/p&gt;
&lt;h3&gt;The Goal&lt;/h3&gt;
&lt;p&gt;
Specification based query support on the repository is a great feature for encapsulation of any query logic. My major problem with this approach was the creation of trivial specifications on a per-domain-object basis. This would litter the code with specifications that had very little functionality contained within them. Generally this is not a bad thing but, in this instance, for the sake of maintainabilty and simplicity I wanted a to be able to perform ad-hoc queries.
&lt;/p&gt;
&lt;p&gt;
The solution was to make my repository able to accept queries like :
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="black"&gt;var&amp;nbsp;repository&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;new&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Repository&amp;lt;Person&amp;gt;(session)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;var&amp;nbsp;people&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;repository&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.FindAll(p&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;nbsp;p.Name&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;==&amp;nbsp;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;steve&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;
&lt;/div&gt;
&lt;h3&gt;The AdHoc specification&lt;/h3&gt;
&lt;p&gt;
Since I have already made the decision that my MatchingCriteria are of type Expression, the AdHoc specification is trivial - but very cool. The implementation looks like :
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="blue"&gt;public&amp;nbsp;class&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;AdHoc&amp;lt;T&amp;gt;&amp;nbsp;:&amp;nbsp;Specification&amp;lt;T&amp;gt;&amp;nbsp;where&amp;nbsp;T&amp;nbsp;:&amp;nbsp;IEntity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;private&amp;nbsp;readonly&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;expression&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;AdHoc(Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;expression)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;this&lt;/font&gt;&lt;font color="black"&gt;.expression&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;expression&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;override&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;MatchingCriteria&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;get&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;{&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;expression&lt;/font&gt;&lt;font color="blue"&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;
&lt;/div&gt;
&lt;h3&gt;Simplifying the repository using the AdHoc specification&lt;/h3&gt;
&lt;p&gt;
By utilising this simple but powerful specification class we can simplify the api to our IRepository. We are now able to add a FindOne and FindAll overload that accept Linq based queries in an AdHoc fashion. The implementation is as simple as :
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IQueryable&amp;lt;T&amp;gt;&amp;nbsp;FindAll(Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;expression)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;FindAll(&lt;/font&gt;&lt;font color="blue"&gt;new&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;AdHoc&amp;lt;T&amp;gt;(expression))&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;/font&gt;
&lt;/div&gt;
&lt;p&gt;
This functionality is able to be consumed in the following fashion (satisfying our goal for this task) :
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="black"&gt;var&amp;nbsp;people&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;repository.FindAll(p&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;nbsp;p.Name&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;==&amp;nbsp;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;steve&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;
&lt;/div&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;
In combination with the flexibility built into the IRepository interface we now have a basis for a data access layer with maximum flexibility. Sql queries are created at execution time to reflect the criteria that we have applied through domain specifications - be they concrete or ad-hoc.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f08%2fLinq-Expressions-The-Specification-Pattern-and-Repositories-Part-3.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f08%2fLinq-Expressions-The-Specification-Pattern-and-Repositories-Part-3.aspx&amp;amp;bgcolor=444444&amp;amp;cbgcolor=BBBBBB" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/zteS0KCx2rQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/zteS0KCx2rQ/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-3.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=715f3020-8162-4a70-9ced-a843a2ada87a</guid>
      <pubDate>Tue, 12 Aug 2008 12:44:00 +1000</pubDate>
      <category>.NET</category>
      <category>Development</category>
      <category>Linq</category>
      <category>NHibernate</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=715f3020-8162-4a70-9ced-a843a2ada87a</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=715f3020-8162-4a70-9ced-a843a2ada87a</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-3.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=715f3020-8162-4a70-9ced-a843a2ada87a</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=715f3020-8162-4a70-9ced-a843a2ada87a</feedburner:origLink></item>
    <item>
      <title>Linq Expressions, The Specification Pattern and Repositories - Part 2</title>
      <description>&lt;p&gt;
In &lt;a href="http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-1.aspx"&gt;Part 1&lt;/a&gt; of this series I expressed my goal of a powerful Linq implementation for the specifications within my domain. In this part of the series I go into further detail and show I have implemented my repositories to support the pattern.
&lt;/p&gt;
&lt;h3&gt;The IRepository definition&lt;/h3&gt;
&lt;p&gt;
In the code below I have restricted my IRepository to be read-only for the purposes of the exercise. Obviously in reality there would be more functionality defined on this interface.
&lt;/p&gt;
&lt;p&gt;
The use of the specification as a parameter to the Find methods is obvious. The use of an Expression is not so obvious at this stage and I will elaborate on this functionality later in the series.
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="blue"&gt;public&amp;nbsp;interface&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IRepository&amp;lt;T&amp;gt;&amp;nbsp;where&amp;nbsp;T&amp;nbsp;:&amp;nbsp;IEntity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T&amp;nbsp;FindOne(Guid&amp;nbsp;id)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;T&amp;nbsp;FindOne(Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;expression)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;T&amp;nbsp;FindOne(Specification&amp;lt;T&amp;gt;&amp;nbsp;specification)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IQueryable&amp;lt;T&amp;gt;&amp;nbsp;FindAll()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IQueryable&amp;lt;T&amp;gt;&amp;nbsp;FindAll(Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;expression)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IQueryable&amp;lt;T&amp;gt;&amp;nbsp;FindAll(Specification&amp;lt;T&amp;gt;&amp;nbsp;specification)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;/font&gt;
&lt;/div&gt;
&lt;h3&gt;The Repository&lt;/h3&gt;
&lt;p&gt;
Implementing the repository means tying oneself to a particular Linq provider. In my case I chose Linq to NHibernate but switching it out for another implementation should be trivial.
&lt;/p&gt;
&lt;p&gt;
See in the repository implementation that work is able to be integrated with the specifications by calling either SatisfyElementFrom (FindOne) of SatisfyElementsFrom (FindAll) and providing a candidate parameter provided by the Linq provider - in this case Linq to NHibernate provides a Queryable list proxy when we specify &lt;em&gt;session.Linq()&lt;/em&gt;.
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="blue"&gt;public&amp;nbsp;class&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Repository&amp;lt;T&amp;gt;&amp;nbsp;:&amp;nbsp;IRepository&amp;lt;T&amp;gt;&amp;nbsp;where&amp;nbsp;T&amp;nbsp;:&amp;nbsp;IEntity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;private&amp;nbsp;readonly&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;ISession&amp;nbsp;session&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Repository(ISession&amp;nbsp;session)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;this&lt;/font&gt;&lt;font color="black"&gt;.session&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;session&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;T&amp;nbsp;FindOne(Guid&amp;nbsp;id)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;session.Get&amp;lt;T&amp;gt;(id)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;T&amp;nbsp;FindOne(Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;expression)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;FindOne(&lt;/font&gt;&lt;font color="blue"&gt;new&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;AdHoc&amp;lt;T&amp;gt;(expression))&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;T&amp;nbsp;FindOne(Specification&amp;lt;T&amp;gt;&amp;nbsp;specification)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;specification.SatisfyingElementFrom(session.Linq&amp;lt;T&amp;gt;())&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IQueryable&amp;lt;T&amp;gt;&amp;nbsp;FindAll()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;(from&amp;nbsp;t&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;in&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;session.Linq&amp;lt;T&amp;gt;()&amp;nbsp;select&amp;nbsp;t)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IQueryable&amp;lt;T&amp;gt;&amp;nbsp;FindAll(Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;expression)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;FindAll(&lt;/font&gt;&lt;font color="blue"&gt;new&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;AdHoc&amp;lt;T&amp;gt;(expression))&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IQueryable&amp;lt;T&amp;gt;&amp;nbsp;FindAll(Specification&amp;lt;T&amp;gt;&amp;nbsp;specification)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;specification.SatisfyingElementsFrom(session.Linq&amp;lt;T&amp;gt;())&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;
&lt;/div&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;
In this article I have shown an implementation of my repository facilitated by the use of Linq to NHibernate. The most striking part is the simplicity of the code. We have nicely seperated out our query concerns and the repository provides us with flexibility and also efficiency thanks to the power of Linq.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f08%2fLinq-Expressions-The-Specification-Pattern-and-Repositories-Part-2.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f08%2fLinq-Expressions-The-Specification-Pattern-and-Repositories-Part-2.aspx&amp;amp;bgcolor=444444&amp;amp;cbgcolor=BBBBBB" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/eZk85G59vnA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/eZk85G59vnA/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-2.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=4539d88e-62b7-44e0-8432-12e831e6166a</guid>
      <pubDate>Tue, 12 Aug 2008 12:16:00 +1000</pubDate>
      <category>.NET</category>
      <category>Development</category>
      <category>Linq</category>
      <category>NHibernate</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=4539d88e-62b7-44e0-8432-12e831e6166a</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=4539d88e-62b7-44e0-8432-12e831e6166a</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-2.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=4539d88e-62b7-44e0-8432-12e831e6166a</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=4539d88e-62b7-44e0-8432-12e831e6166a</feedburner:origLink></item>
    <item>
      <title>Linq Expressions, The Specification Pattern and Repositories - Part 1</title>
      <description>&lt;p&gt;
&lt;br /&gt;
Disclaimer : I am unsure if what I am about to show here is a bridge too far in terms of bastardising the specification pattern ... it very well may be the case. However, Linq has provided a new paradigm that needs to be embraced, and sometimes that requires the tweaking of existing pratices and patterns.
&lt;/p&gt;
&lt;h3&gt;Background Info&lt;/h3&gt;
&lt;p&gt;
For some background on this article I recommend reading the following primers. I would never have to got to where I did without them. Please check out:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://ubik.com.au/article/named/implementing_the_specification_pattern_with_linq"&gt;Implementing the Specification Pattern via Linq&lt;/a&gt; &lt;br /&gt;
[&lt;a href="http://ubik.com.au/article/named/implementing_the_specification_pattern_with_linq"&gt;http://ubik.com.au/article/named/implementing_the_specification_pattern_with_linq&lt;/a&gt;]&lt;br /&gt;
&lt;a href="http://www.iridescence.no/post/Linq-the-Specification-Pattern-and-Encapsulation.aspx"&gt;&lt;br /&gt;
Linq, the Specification Pattern and Encapsulation&lt;/a&gt;&lt;br /&gt;
[&lt;a href="http://www.iridescence.no/post/Linq-the-Specification-Pattern-and-Encapsulation.aspx"&gt;http://www.iridescence.no/post/Linq-the-Specification-Pattern-and-Encapsulation.aspx&lt;/a&gt;] &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://rabdullin.com/implementing-orm-independent-linq-queries/"&gt;Implementing ORM-independent Linq queries&lt;/a&gt;&lt;br /&gt;
[&lt;a href="http://rabdullin.com/implementing-orm-independent-linq-queries/"&gt;http://rabdullin.com/implementing-orm-independent-linq-queries/&lt;/a&gt;]
&lt;/p&gt;
&lt;h3&gt;The Goal&lt;/h3&gt;
&lt;p&gt;
I wanted a flexible way to leverage the deferred execution power of Linq in my application. The logical place for this to occur was deep in the data access layer at the repository level. Also, as always, I wanted the ability to encapsulate my query logic into specifications and this became the real integration challenge with linq.
&lt;/p&gt;
&lt;p&gt;
Specifications are easy to apply to existing in-memory collections - they fit that paradigm well. But at the lower level I knew linq could provide more power than what was previously possible with the traditional specification pattern. I wanted a way to leverage the deffered execution of Linq to drive my specifications for querying. 
&lt;/p&gt;
&lt;h3&gt;The Specification Class&lt;/h3&gt;
&lt;p&gt;
My specification class is not dependent on any particular Linq to SQL provider. I chose to use Linq to NHibernate but that was a personal choice. I am quite sure that a switch to Linq-To-SQL would result in no modifications to any existing specifications. This provider agnostic specification implementation is a nice example of what a common language paradigm like Linq can provide.
&lt;/p&gt;
&lt;p&gt;
Notice that the base abstract specification class handles all of the matching work for the specification. Any inheriting specification simply needs to specify their relevant MatchingCriteria. The SatisfyingElementFrom method (singular) simply enforces that a single result is returned. The bulk of the work is done in SatisfyingElementsFrom, which actually applies the criteria. Note that it is critical that the Matching criteria is of type Expression. This ensures we have access to the expression parsing power of Linq. Simply using a Func or a Predicate will break this implementation.
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="blue"&gt;public&amp;nbsp;abstract&amp;nbsp;class&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Specification&amp;lt;T&amp;gt;&amp;nbsp;where&amp;nbsp;T&amp;nbsp;:&amp;nbsp;IEntity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;abstract&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Expression&amp;lt;Func&amp;lt;T,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;MatchingCriteria&amp;nbsp;{&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;get;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;T&amp;nbsp;SatisfyingElementFrom(IQueryable&amp;lt;T&amp;gt;&amp;nbsp;candidates)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;SatisfyingElementsFrom(candidates).Single()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;IQueryable&amp;lt;T&amp;gt;&amp;nbsp;SatisfyingElementsFrom(IQueryable&amp;lt;T&amp;gt;&amp;nbsp;candidates)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;candidates.Where(MatchingCriteria).AsQueryable()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;
&lt;/div&gt;
&lt;h3&gt;A simple specification&lt;/h3&gt;
&lt;p&gt;
Below is the code for a simple specification implementation. Notice how it has no responsibility apart from specifying the criteria that it represents.
&lt;/p&gt;
&lt;div class="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="blue"&gt;public&amp;nbsp;class&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;PersonById&amp;nbsp;:&amp;nbsp;Specification&amp;lt;Person&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;private&amp;nbsp;readonly&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Guid&amp;nbsp;id&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;PersonById(Guid&amp;nbsp;id)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;this&lt;/font&gt;&lt;font color="black"&gt;.id&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;id&lt;/font&gt;&lt;font color="blue"&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;public&amp;nbsp;override&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;Expression&amp;lt;Func&amp;lt;Person,&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;bool&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;gt;&amp;nbsp;MatchingCriteria&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;get&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;{&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;p&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&amp;nbsp;p.Id&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;==&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;id&lt;/font&gt;&lt;font color="blue"&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;
&lt;/div&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;
So far I have demonstrated how to implement specification classes that have the potential to harness the power of Linq. Please follow the other parts of the series to see further implementation details - specifically the repository.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f08%2fLinq-Expressions-The-Specification-Pattern-and-Repositories-Part-1.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f08%2fLinq-Expressions-The-Specification-Pattern-and-Repositories-Part-1.aspx&amp;amp;bgcolor=444444&amp;amp;cbgcolor=BBBBBB" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/jBuf5upfgUE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/jBuf5upfgUE/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-1.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=5c5f6ba0-555d-4125-920b-243da17b436b</guid>
      <pubDate>Tue, 12 Aug 2008 11:23:00 +1000</pubDate>
      <category>.NET</category>
      <category>Development</category>
      <category>Linq</category>
      <category>NHibernate</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=5c5f6ba0-555d-4125-920b-243da17b436b</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=5c5f6ba0-555d-4125-920b-243da17b436b</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/08/Linq-Expressions-The-Specification-Pattern-and-Repositories-Part-1.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=5c5f6ba0-555d-4125-920b-243da17b436b</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=5c5f6ba0-555d-4125-920b-243da17b436b</feedburner:origLink></item>
    <item>
      <title>Collapsing and Expanding Regions in Visual Studio</title>
      <description>&lt;p&gt;
Whilst there is still &lt;a href="http://www.codinghorror.com/blog/archives/001147.html"&gt;ongoing debate&lt;/a&gt; about the merit of using regions, I have to admit that I have no strong leaning towards any side of the argument. However, I do need the ability to hide and show all of the regions in a class quickly and easily.
&lt;/p&gt;
&lt;p&gt;
A trick that I first picked up when using VS2003 still works for me today and can quickly push you towards indifference in the debate as well.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
This &lt;a href="http://weblogs.asp.net/rweigelt/archive/2003/07/06/9741.aspx"&gt;article&lt;/a&gt; written by &lt;a href="http://weblogs.asp.net/rweigelt/"&gt;Roland Weigelt&lt;/a&gt; (in 2003!) lists the code for some macros that can be simply assigned to a keyboard shortcut to help manage any regions you come across. Because, regardless of your stance on the issue, you will always come across regions somewhere.
&lt;/p&gt;
&lt;p&gt;
Below I have assembled a short guide to installing and using the macros -
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;1. Copy all of the macro source code from the original article &lt;em&gt;but only the module code itself&lt;/em&gt; (i.e ignoring the import statements and module declaration - these are added by VS automatically when you create a new module). The code below has been stolen from the &lt;a href="http://weblogs.asp.net/rweigelt/archive/2003/07/06/9741.aspx"&gt;original article&lt;/a&gt; and reproduced here for convenience&lt;/strong&gt;.&amp;nbsp;
&lt;/p&gt;
&lt;div class="code"&gt;
&lt;font color="darkgreen"&gt;&amp;#39;&amp;nbsp;Toggles&amp;nbsp;the&amp;nbsp;current&amp;nbsp;region&amp;nbsp;surrounding&amp;nbsp;the&amp;nbsp;cursor&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Sub&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;ToggleParentRegion()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Dim&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;objSelection&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;As&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;TextSelection&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objSelection&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;DTE.ActiveDocument.Selection&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Dim&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;objPosition&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;As&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;EnvDTE.TextPoint&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objPosition&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;objSelection.AnchorPoint&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objSelection.SelectLine()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;If&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;(&lt;/font&gt;&lt;font color="blue"&gt;InStr&lt;/font&gt;&lt;font color="black"&gt;(objSelection.Text.ToLower(),&amp;nbsp;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;#region&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&amp;nbsp;&amp;lt;&amp;gt;&amp;nbsp;&lt;/font&gt;&lt;font color="maroon"&gt;0&lt;/font&gt;&lt;font color="black"&gt;)&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Then&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="darkgreen"&gt;&amp;#39;&amp;nbsp;Updated&amp;nbsp;14.08.2003&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;objSelection.MoveToPoint(objPosition)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DTE.ExecuteCommand(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;Edit.ToggleOutliningExpansion&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;ElseIf&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;(objSelection.FindText(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;#region&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;,&amp;nbsp;vsFindOptions.vsFindOptionsBackwards))&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Then&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DTE.ExecuteCommand(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;Edit.ToggleOutliningExpansion&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;objSelection.MoveToPoint(objPosition)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;End&amp;nbsp;If&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;End&amp;nbsp;Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="darkgreen"&gt;&amp;#39;&amp;nbsp;Expands&amp;nbsp;all&amp;nbsp;regions&amp;nbsp;in&amp;nbsp;the&amp;nbsp;current&amp;nbsp;document&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Sub&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;ExpandAllRegions()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DTE.ExecuteCommand(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;Edit.StopOutlining&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DTE.ExecuteCommand(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;Edit.StartAutomaticOutlining&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;End&amp;nbsp;Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="darkgreen"&gt;&amp;#39;&amp;nbsp;Collapses&amp;nbsp;all&amp;nbsp;regions&amp;nbsp;in&amp;nbsp;the&amp;nbsp;current&amp;nbsp;document&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Sub&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;CollapseAllRegions()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExpandAllRegions()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;Dim&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;objSelection&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;As&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;TextSelection&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objSelection&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;DTE.ActiveDocument.Selection&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objSelection.StartOfDocument()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;While&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;(objSelection.FindText(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;#region&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objSelection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DTE.ExecuteCommand(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;Edit.ToggleOutliningExpansion&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objSelection.StartOfDocument()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;End&amp;nbsp;While&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="black"&gt;DTE.ActiveDocument.Selection.StartOfDocument()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="blue"&gt;End&amp;nbsp;Sub&lt;/font&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;
&lt;br /&gt;
&lt;strong&gt;2. In Visual Studio (VS2008 in this example) open the Macros IDE (Alt-F11 or under Tools -&amp;gt; Macros)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;3. In the Macros IDE, add a new macros module called &lt;em&gt;RegionTools &lt;/em&gt;by right-clicking on MyMacros and select Add -&amp;gt; Add Module&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;4. Paste the code copied from above inside the module definition &lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;5. Save and the close the Macros IDE&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;6. Now assign your keyboard shortcuts. Open the Options menu by opening Tools -&amp;gt; Options in Visual Studio&lt;/strong&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;7. Under Environment in the tree menu (left hand side of the Options dialog), select Keyboard&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;8. Filter all of the available commands by typing &lt;em&gt;RegionTools &lt;/em&gt;in the&amp;nbsp; filter box&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
&lt;img src="http://www.mostlyclean.com/image.axd?picture=2.jpg" alt="" /&gt;&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
9. You should now see the 3 new macros that you added to the Macros IDE. And now you can assign them keyboard shortcuts at your whim. Personally I only use CollapseAllRegions (mapped to Ctrl+Shift+Num -) and ExpandAllRegions (mapped to Ctrl+Shift+Num +). But they are both of enormous benefit.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;Now all that is left is for someone to tell me this has been built in to VS2008! 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/mNZJwlAlP-A" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/mNZJwlAlP-A/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/08/Collapsing-and-Expanding-Regions-in-Visual-Studio.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=7fe00fda-a452-4da3-8fa1-2a47855ac0ab</guid>
      <pubDate>Wed, 06 Aug 2008 13:34:00 +1000</pubDate>
      <category>.NET</category>
      <category>Development</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=7fe00fda-a452-4da3-8fa1-2a47855ac0ab</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=7fe00fda-a452-4da3-8fa1-2a47855ac0ab</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/08/Collapsing-and-Expanding-Regions-in-Visual-Studio.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=7fe00fda-a452-4da3-8fa1-2a47855ac0ab</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=7fe00fda-a452-4da3-8fa1-2a47855ac0ab</feedburner:origLink></item>
    <item>
      <title>TDD Screencast 2 has crashed and burned</title>
      <description>&lt;p&gt;
No good deed goes unpunished and my attempt to create a second screencast adheres strongly to that rule. 
&lt;/p&gt;
&lt;p&gt;
Late last week I stayed up and recorded 45 minutes worth of footage only to discover that the wrong microphone input was selected! This means that I had TDD video with no TDD soundtrack. To soften the blow I thought I would save the video and maybe record a voiceover in a seperate session.
&lt;/p&gt;
&lt;p&gt;
Strike 2! Camtasia crashed whilst saving the video file so I was left with precisely no fruits from my labour.
&lt;/p&gt;
&lt;p&gt;
I intend to get around to it eventually but have to admit that my motivation has dipped significantly.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/S__gzVEZ12U" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/S__gzVEZ12U/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/07/TDD-Screencast-2-has-crashed-and-burned.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=47db8eed-9132-49d4-be1b-e530d4e04b44</guid>
      <pubDate>Tue, 29 Jul 2008 16:09:00 +1000</pubDate>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=47db8eed-9132-49d4-be1b-e530d4e04b44</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=47db8eed-9132-49d4-be1b-e530d4e04b44</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/07/TDD-Screencast-2-has-crashed-and-burned.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=47db8eed-9132-49d4-be1b-e530d4e04b44</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=47db8eed-9132-49d4-be1b-e530d4e04b44</feedburner:origLink></item>
    <item>
      <title>Test Driven Development Screencast (1 of x)</title>
      <description>&lt;p&gt;
So after a lenghty layoff and many broken promises I am back into the blogging fold with a brand new screencast. I have been keen to demo Camtasia for a while and am pretty happy with the results. And it should make for a better end user experience because I am not a very good writer!
&lt;/p&gt;
&lt;p&gt;
The video shows off some of the tricks, tools and techniques for TDD in .Net. It was cool to play with Gallio for the first time and I am loving its integration with Resharper. Very nice.
&lt;/p&gt;
&lt;p&gt;
For best result watch the video in its original size (the quality if you do that is surprisingly good). To access the original size -
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Click the full screen button in the top right corner.&lt;/li&gt;
	&lt;li&gt;Click the menu button in the bottom left corner.&lt;br /&gt;
	&lt;/li&gt;
	&lt;li&gt;Then in the menu along the top of the screen click &amp;#39;Original size&amp;#39;.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Alternatively, if you prefer to watch the video offline you can download from Viddler by clicking &lt;a href="http://www.viddler.com/download/flv/607f3452"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" id="viddler_607f3452" width="545" height="451"&gt;
	&lt;param name="id" value="viddler_607f3452" /&gt;
	&lt;param name="width" value="545" /&gt;
	&lt;param name="height" value="451" /&gt;
	&lt;param name="allowscriptaccess" value="always" /&gt;
	&lt;param name="allowfullscreen" value="true" /&gt;
	&lt;param name="src" value="http://www.viddler.com/player/607f3452/" /&gt;
	&lt;embed type="application/x-shockwave-flash" id="viddler_607f3452" width="545" height="451" allowscriptaccess="always" allowfullscreen="true" src="http://www.viddler.com/player/607f3452/"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f07%2fTest-Driven-Development-Screencast-(1-of-x).aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.mostlyclean.com%2fpost%2f2008%2f07%2fTest-Driven-Development-Screencast-(1-of-x).aspx&amp;amp;bgcolor=444444&amp;amp;cbgcolor=BBBBBB" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/xhaFzcehRpY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/xhaFzcehRpY/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/07/Test-Driven-Development-Screencast-(1-of-x).aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=e6df0ebe-b964-4424-b141-4f61ae7bf605</guid>
      <pubDate>Sun, 13 Jul 2008 15:23:00 +1000</pubDate>
      <category>.NET</category>
      <category>ALT.NET</category>
      <category>Development</category>
      <category>Screencasts</category>
      <category>TDD</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=e6df0ebe-b964-4424-b141-4f61ae7bf605</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=e6df0ebe-b964-4424-b141-4f61ae7bf605</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/07/Test-Driven-Development-Screencast-(1-of-x).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=e6df0ebe-b964-4424-b141-4f61ae7bf605</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=e6df0ebe-b964-4424-b141-4f61ae7bf605</feedburner:origLink></item>
    <item>
      <title>Windsor Container AddComponentInstance bug</title>
      <description>&lt;p&gt;
I am &lt;a href="http://groups.google.com/group/castle-project-users/browse_thread/thread/a86218cb6f2270e9"&gt;reliably informed&lt;/a&gt; that this error has been fixed on the trunk but it is most definitely still occurring in the assembly version that I am referencing. Assuming that others arent working from the latest version of the trunk I thought it would be worth recording here both the bug and the workaround.
&lt;/p&gt;
&lt;p&gt;
In my tests I typically attempt to mock my dependencies. Then I inject the mock into the container so that it is retrievable by my calling code. But alas, calling AddComponentInstance with the following method signature failed.
&lt;/p&gt;
&lt;div class="code"&gt;
&lt;font color="black"&gt;AddComponentInstance&amp;lt;IExceptionHandler&amp;lt;NotImplementedException&amp;gt;&amp;gt;(mockHandler)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;
&lt;/div&gt;
&lt;p style="text-align: left"&gt;
The error reported :&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;
No component for supporting the service Project.Web.Controllers.ExceptionHandlers.IExceptionHandler`1[[System.NotImplementedException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] was found
Castle.MicroKernel.ComponentNotFoundException&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
The workaround is to simply use a different method signature which assumedly under the covers registers the component and the instance correctly. See:
&lt;/p&gt;
&lt;div class="code"&gt;
&lt;font color="black"&gt;AddComponentInstance&amp;lt;IExceptionHandler&amp;lt;NotImplementedException&amp;gt;&amp;gt;( &lt;/font&gt;&lt;font color="blue"&gt;typeof&lt;/font&gt;&lt;font color="black"&gt;(IExceptionHandler&amp;lt;NotImplementedException&amp;gt;),&amp;nbsp;mockHandler)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;
&lt;/div&gt;
&lt;p&gt;
Ta da.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/o3Zb51Bvszw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/o3Zb51Bvszw/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2008/02/Windsor-Container-AddComponentInstance-bug.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=6c9b5169-d147-42a9-9625-4a457f81acc6</guid>
      <pubDate>Thu, 14 Feb 2008 10:12:00 +1000</pubDate>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=6c9b5169-d147-42a9-9625-4a457f81acc6</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=6c9b5169-d147-42a9-9625-4a457f81acc6</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2008/02/Windsor-Container-AddComponentInstance-bug.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=6c9b5169-d147-42a9-9625-4a457f81acc6</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=6c9b5169-d147-42a9-9625-4a457f81acc6</feedburner:origLink></item>
    <item>
      <title>Is today MVC day?</title>
      <description>&lt;img style="margin-left: 15px; margin-bottom: 15px" src="http://www.mostlyclean.com/image.axd?picture=benji+marshall.jpg" alt="System.Web.MVC makes me a very happy man" title="A happy man" align="right" /&gt;
&lt;p&gt;
After a barrage of blog posts and primers from the guys on the other side &lt;a href="http://blog.wekeroad.com/2007/12/06/aspnet-mvc-using-restful-architecture/"&gt;of&lt;/a&gt; &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc-framework-part-3-passing-viewdata-from-controllers-to-views.aspx"&gt;the&lt;/a&gt; &lt;a href="http://haacked.com/archive/2007/11/14/writing-testable-code-is-about-managing-complexity.aspx"&gt;fence&lt;/a&gt;, it appears that today might be the day that System.Web.MVC is released.
&lt;/p&gt;
&lt;p&gt;
To say that I am excited would be an understatement. Mainstream acceptance and support (from the big machine) means that we can now propose this style of development without fear of recrimination from cowering/OSS averse decision makers. To me this is the most powerful component of this release as it is by no means revolutionary from a technology standpoint.
&lt;/p&gt;
&lt;p&gt;
I have the perfect project for MVC sitting in the wings and I can now unleash. Thanks Microsoft for having the vision to support the concepts that we developers hold dear. I accept that things from MS will never be on the bleeding edge, but at least they are beginning to get a lot closer.
&lt;/p&gt;
&lt;p&gt;
I can&amp;#39;t wait. Bring on the CTP!
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheMostlyCleanCoder/~4/Jy1svQJWaiI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/TheMostlyCleanCoder/~3/Jy1svQJWaiI/post.aspx</link>
      <author>steven.burman</author>
      <comments>http://www.mostlyclean.com/post/2007/12/Is-today-MVC-day.aspx#comment</comments>
      <guid isPermaLink="false">http://www.mostlyclean.com/post.aspx?id=45300206-68f0-4420-b8a5-e9419a1e4091</guid>
      <pubDate>Fri, 07 Dec 2007 22:30:00 +1000</pubDate>
      <category>ASP.NET</category>
      <category>.NET</category>
      <category>Development</category>
      <dc:publisher>steven.burman</dc:publisher>
      <pingback:server>http://www.mostlyclean.com/pingback.axd</pingback:server>
      <pingback:target>http://www.mostlyclean.com/post.aspx?id=45300206-68f0-4420-b8a5-e9419a1e4091</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.mostlyclean.com/trackback.axd?id=45300206-68f0-4420-b8a5-e9419a1e4091</trackback:ping>
      <wfw:comment>http://www.mostlyclean.com/post/2007/12/Is-today-MVC-day.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.mostlyclean.com/syndication.axd?post=45300206-68f0-4420-b8a5-e9419a1e4091</wfw:commentRss>
    <feedburner:origLink>http://www.mostlyclean.com/post.aspx?id=45300206-68f0-4420-b8a5-e9419a1e4091</feedburner:origLink></item>
  </channel>
</rss>
