<?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:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>aspZone.com</title><link>http://aspzone.com/</link><description>John Rudolf Lewis' blog</description><generator>Graffiti CMS 1.0 (build 1.0.1.963)</generator><lastBuildDate>Thu, 09 Jul 2009 15:22:00 GMT</lastBuildDate><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/aspZone" type="application/rss+xml" /><item><title>Remote Desktop on a Second Monitor</title><link>http://feedproxy.google.com/~r/aspZone/~3/CoIm0OgDmZE/</link><pubDate>Thu, 09 Jul 2009 15:22:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/tech/remote-desktop-on-a-second-monitor/</guid><dc:creator>john</dc:creator><slash:comments>0</slash:comments><category domain="http://aspzone.com/tech/">Tech</category><description>I am blogging this &lt;a href="http://www.hydrous.net/weblog/2008/03/13/remote-desktop-on-a-second-monitor" target="_blank"&gt;link&lt;/a&gt; so that when I forget (again) how to do it, I can find it more easily.</description><feedburner:origLink>http://aspzone.com/tech/remote-desktop-on-a-second-monitor/</feedburner:origLink></item><item><title>ASP.NET MVC File Upload</title><link>http://feedproxy.google.com/~r/aspZone/~3/4KcfF05tbq8/</link><pubDate>Sun, 26 Apr 2009 14:35:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/tech/asp-net-mvc-file-upload/</guid><dc:creator>john</dc:creator><slash:comments>2</slash:comments><category domain="http://aspzone.com/tech/">Tech</category><description>&lt;p&gt;This very short blog post will show you how to add support for uploading files to an ASP.NET MVC application.&lt;/p&gt;  &lt;h1&gt;Add a controller action&lt;/h1&gt;  &lt;p&gt;Add a controller action that accepts a parameter of type HttpPostedFileBase. In the example below, I save the file to my App_Data folder. I would highly recommend that you redirect the browser to another action when done.&lt;/p&gt;  &lt;pre&gt;public ActionResult Upload(HttpPostedFileBase file)
{
    var fileName = Path.Combine(Request.MapPath(&amp;quot;~/App_Data&amp;quot;), Path.GetFileName(file.FileName));
    file.SaveAs(fileName);
    return RedirectToAction(&amp;quot;Index&amp;quot;);
}&lt;/pre&gt;

&lt;h1&gt;Add an upload form&lt;/h1&gt;

&lt;p&gt;Add an upload form. Set the action to your upload controller action, the method to post, and very important, the enctype to multipart/form-data.&lt;/p&gt;

&lt;pre&gt;&amp;lt;form action=&amp;quot;/Home/Upload&amp;quot; method=&amp;quot;post&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot;&amp;gt;
    &amp;lt;label&amp;gt;Filename: &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;file&amp;quot; /&amp;gt;&amp;lt;/label&amp;gt;
    &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot; /&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;

&lt;h1&gt;You’re done&lt;/h1&gt;

&lt;p&gt;That is all that is needed. Compile your app and give it a try. You &lt;a href="http://code.google.com/p/johnrudolflewis/source/browse/#svn/SimpleMvcFileUpload" target="_blank"&gt;browse&lt;/a&gt; or &lt;a href="http://johnrudolflewis.googlecode.com/svn/SimpleMvcFileUpload/" target="_blank"&gt;checkout&lt;/a&gt; the full source code from my googlecode repository.&lt;/p&gt;</description><feedburner:origLink>http://aspzone.com/tech/asp-net-mvc-file-upload/</feedburner:origLink></item><item><title>StructureMap/Ninject + log4net</title><link>http://feedproxy.google.com/~r/aspZone/~3/McvlF0KJNs8/</link><pubDate>Tue, 07 Apr 2009 15:25:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/tech/structuremap-ninject-log4net/</guid><dc:creator>john</dc:creator><slash:comments>1</slash:comments><category domain="http://aspzone.com/tech/">Tech</category><description>&lt;p&gt;One fine day, my task was to refactor my classes so they did not have a dependency on log4net.&lt;/p&gt;
&lt;p&gt;The first thing I did was to create an ILogger interface in my core library, and an Log4NetLogger class in my infrastructure library. Followed by adding a line to my IoC container bootstrapper class. Finally, I added an ILogger constructor argument to each of my classes that needed logging. Finished in no time, or so I thought.&lt;/p&gt;
&lt;h2&gt;&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;The Problem&lt;/h2&gt;
&lt;p&gt;I quickly realized that the contents of my log files had lost one important piece of information that nearly rendered them useless.&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" size="1"&gt;2009-04-07 07:10:15,810 [1] DEBUG aspZone.LoggingExample.Log4NetLogger &amp;ndash; Called Foo.DoSomething &lt;br /&gt;
2009-04-07 07:10:15,843 [1] DEBUG aspZone.LoggingExample.Log4NetLogger &amp;ndash; Called Bar.DoSomething&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;In my Log4NetLogger constructor, I had called LogManager.GetLogger as per common practice:&lt;/p&gt;
&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Log4NetLogger()&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.logger = log4net.LogManager.GetLogger(&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;         System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As a result, there was no way to filter my log entries by which logger they came from. Every single log entry looked like it came from Log4NetLogger. This had to change.&lt;/p&gt;
&lt;h2&gt;The Solution&lt;/h2&gt;
&lt;p&gt;After a bunch of searching and a few tweets, I found what I think is a very neat solution.&lt;/p&gt;
&lt;p&gt;I changed my ILogger interface to ILogger&amp;lt;T&amp;gt;:&lt;/p&gt;
&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; aspZone.LoggingExample&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; ILogger&amp;lt;T&amp;gt;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Debug(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; message);&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// ...&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And I modified my Log4NetLogger like this:&lt;/p&gt;
&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; log4net;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; aspZone.LoggingExample&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Log4NetLogger&amp;lt;T&amp;gt; : ILogger&amp;lt;T&amp;gt;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;readonly&lt;/span&gt; ILog logger;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Log4NetLogger()&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.logger = LogManager.GetLogger(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(T));&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// ...&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And using generic type inference, a syntax I was previously unaware of, to register the types in StructureMap:&lt;/p&gt;
&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; StructureMap.Configuration.DSL;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; aspZone.LoggingExample&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ExampleRegistry : Registry&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ExampleRegistry()&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;             ForRequestedType(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(ILogger&amp;lt;&amp;gt;))&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;                 .TheDefaultIsConcreteType(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Log4NetLogger&amp;lt;&amp;gt;));&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;             &lt;span style="color: #008000"&gt;// ...&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The syntax for Ninject is very similar:&lt;/p&gt;
&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; Bind(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(ILogger&amp;lt;&amp;gt;)).To(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Log4NetLogger&amp;lt;&amp;gt;));&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;My log entries are filterable like they were before.&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" size="1"&gt;2009-04-07 07:10:15,810 [1] DEBUG aspZone.LoggingExample.Foo &amp;ndash; Called Foo.DoSomething &lt;br /&gt;
2009-04-07 07:10:15,843 [1] DEBUG aspZone.LoggingExample.Bar &amp;ndash; Called Bar.DoSomething&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;And now I have much better separation of concerns.&lt;/p&gt;</description><feedburner:origLink>http://aspzone.com/tech/structuremap-ninject-log4net/</feedburner:origLink></item><item><title>ALT.NET Programming Contest</title><link>http://feedproxy.google.com/~r/aspZone/~3/rGL1Zh4PK4w/</link><pubDate>Fri, 06 Mar 2009 15:17:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/tech/alt-net-programming-contest/</guid><dc:creator>john</dc:creator><slash:comments>0</slash:comments><category domain="http://aspzone.com/tech/">Tech</category><description>&lt;p&gt;Last weekend, I went to the ALT.NET Seattle Open Spaces&amp;nbsp; event. It was an awesome experience to talk with all my blogging heroes.&lt;/p&gt;
&lt;p&gt;On Saturday night, they held a programming contest. I won!&lt;/p&gt;
&lt;p&gt;&lt;a title="http://codebetter.com/blogs/aaron.jensen/archive/2009/03/05/the-alt-net-programming-contest.aspx" href="http://codebetter.com/blogs/aaron.jensen/archive/2009/03/05/the-alt-net-programming-contest.aspx"&gt;http://codebetter.com/blogs/aaron.jensen/archive/2009/03/05/the-alt-net-programming-contest.aspx&lt;/a&gt;&lt;/p&gt;</description><feedburner:origLink>http://aspzone.com/tech/alt-net-programming-contest/</feedburner:origLink></item><item><title>Is this a good way to wire up NHibernate using StructureMap?</title><link>http://feedproxy.google.com/~r/aspZone/~3/dDdFrcwLLEw/</link><pubDate>Sat, 28 Feb 2009 00:18:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/tech/is-this-a-good-way-to-wire-up-nhibernate-using-structuremap/</guid><dc:creator>john</dc:creator><slash:comments>1</slash:comments><category domain="http://aspzone.com/tech/">Tech</category><description>&lt;p&gt;I am blogging this code snippet in order to ask some people at &lt;a href="http://altnetseattle.pbwiki.com/" target="_blank"&gt;altnetseattle&lt;/a&gt; if this is a good implementation or not.&lt;/p&gt;  &lt;p&gt;I want to know whether or not this is considered a good way of wiring up &lt;a href="http://www.hibernate.org/343.html" target="_blank"&gt;NHibernate&lt;/a&gt; using &lt;a href="http://structuremap.sourceforge.net/Default.htm" target="_blank"&gt;StructureMap&lt;/a&gt;. I am making use of the registry DSL feature, this code would get called somewhere in my bootstrapper.&lt;/p&gt;  &lt;p&gt;Elsewhere in my code, my Repositories simply have a constructor dependency on ISession.&lt;/p&gt;  &lt;p&gt;NHibernateConfiguration is my class that does all configuration of NHibernate using FluentNHibernate.&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DataAccessRegistry : Registry&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; DataAccessRegistry()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// NHibernate ISessionFactory&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         ForRequestedType&amp;lt;ISessionFactory&amp;gt;()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;             .CacheBy(InstanceScope.Singleton)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;             .TheDefault.Is.ConstructedBy(() =&amp;gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NHibernateConfiguration().BuildSessionFactory());&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// NHibernate ISession&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         ForRequestedType&amp;lt;ISession&amp;gt;()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;             .CacheBy(InstanceScope.Hybrid)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;             .TheDefault.Is.ConstructedBy(() =&amp;gt; ObjectFactory.GetInstance&amp;lt;ISessionFactory&amp;gt;().OpenSession());&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;</description><feedburner:origLink>http://aspzone.com/tech/is-this-a-good-way-to-wire-up-nhibernate-using-structuremap/</feedburner:origLink></item><item><title>02/24/09 Tank Photos</title><link>http://feedproxy.google.com/~r/aspZone/~3/xM6csS9-hEs/</link><pubDate>Wed, 25 Feb 2009 01:56:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/reef/02-24-09-tank-photo/</guid><dc:creator>john</dc:creator><slash:comments>0</slash:comments><category domain="http://aspzone.com/reef/">Reef</category><description>&lt;p&gt;&lt;a target="_blank" href="http://s432.photobucket.com/albums/qq47/JohnRudolf/?action=view&amp;amp;current=IMG_1611.jpg"&gt;&lt;img alt="" src="http://i432.photobucket.com/albums/qq47/JohnRudolf/th_IMG_1611.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://s432.photobucket.com/albums/qq47/JohnRudolf/?action=view&amp;current=IMG_1613.jpg" target="_blank"&gt;&lt;img src="http://i432.photobucket.com/albums/qq47/JohnRudolf/th_IMG_1613.jpg" border="0" alt="Photobucket" &gt;&lt;/a&gt;
&lt;/p&gt;</description><feedburner:origLink>http://aspzone.com/reef/02-24-09-tank-photo/</feedburner:origLink></item><item><title>How NHibernate saved my day</title><link>http://feedproxy.google.com/~r/aspZone/~3/aGXG9Hr9yNs/</link><pubDate>Thu, 08 Jan 2009 19:42:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/tech/as-a-result-of-using-nhibernate-switching-database-vendors-on-a-project-took-less-than-5-minutes/</guid><dc:creator>john</dc:creator><slash:comments>0</slash:comments><category domain="http://aspzone.com/tech/">Tech</category><description>&lt;p&gt;I am working on an ecommerce site as a personal learning project. Rob Conery’s MVC Storefront series of blog posts was my inspiration. However, I am following a different path. I am using NHibernate instead of Linq-To-Sql.&lt;/p&gt;  &lt;p&gt;I determined that the hosting budget for this little project would be exceeded by any reputable hosting provider that offers Microsoft SQL server. I did find, however, several hosting providers that offered MySql at an acceptable rate.&lt;/p&gt;  &lt;p&gt;After a half hour or so of fumbling around with installing MySql on my dev box for the very first time, and setting up an empty database, it was time to migrate my code over.&lt;/p&gt;  &lt;p&gt;A couple of NHibernate configuration changes, and a couple of minor tweaks (and I mean very minor), my entire project was working against MySql. My database integration tests export the schema to the database, so I didn’t even have to create any tables manually. Migrating my code from one database vendor to another took less than 5 minutes.&lt;/p&gt;  &lt;p&gt;I sat back and said to myself, “Wow!”&lt;/p&gt;  &lt;p&gt;I shared this experience with a couple of co-workers, and they said the same thing.&lt;/p&gt;</description><feedburner:origLink>http://aspzone.com/tech/as-a-result-of-using-nhibernate-switching-database-vendors-on-a-project-took-less-than-5-minutes/</feedburner:origLink></item><item><title>Using the Code Behind in MVC causes blindness</title><link>http://feedproxy.google.com/~r/aspZone/~3/znw7_-8OTgI/</link><pubDate>Fri, 12 Dec 2008 18:37:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/tech/using-the-code-behind-in-mvc-causes-blindness/</guid><dc:creator>john</dc:creator><slash:comments>0</slash:comments><category domain="http://aspzone.com/tech/">Tech</category><description>&lt;p&gt;LOL for the funny post title. &lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/12/12/psa-using-the-code-behind-in-mvc-causes-blindness.aspx" target="_blank"&gt;Derik&lt;/a&gt; wrote a great post with a great list of tips to live by:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Keep your Code Behind empty &lt;/li&gt;    &lt;li&gt;Keep your Views simple &lt;/li&gt;    &lt;li&gt;Keep your Controllers light &lt;/li&gt;    &lt;li&gt;Keep your Model fat (domain model that is)&lt;/li&gt; &lt;/ol&gt;</description><feedburner:origLink>http://aspzone.com/tech/using-the-code-behind-in-mvc-causes-blindness/</feedburner:origLink></item><item><title>How to get WebORB and ASP.NET MVC to work together.</title><link>http://feedproxy.google.com/~r/aspZone/~3/VP_llYhfaqk/</link><pubDate>Tue, 09 Dec 2008 18:28:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/tech/how-to-get-weborb-and-asp-net-mvc-to-work-together/</guid><dc:creator>john</dc:creator><slash:comments>0</slash:comments><category domain="http://aspzone.com/tech/">Tech</category><description>&lt;p&gt;As mentioned before, I have been writing some RIA applications using Flex. I've also been playing with ASP.NET MVC. I have one project where I am considering combining the two. &lt;/p&gt;  &lt;p&gt;I have been using &lt;a href="http://www.themidnightcoders.com/products/weborb-for-net/overview.html" target="_blank"&gt;WebORB&lt;/a&gt; from &lt;a href="http://www.themidnightcoders.com/" target="_blank"&gt;MidnightCoders&lt;/a&gt; as my communication layer between .NET and Flex. I've been really happy with it. It does not, however, work properly with the ASP.NET MVC framework. When you copy the WebORB bits into the web application, and try to browse the console, you get the &amp;quot;Oops, something went wrong...&amp;quot; error.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://aspzone.com/files/media/image/WindowsLiveWriter/HowtogetWebORBandASP.NETMVCtoworktogeth_8F95/OopsError_2.jpg"&gt;&lt;img title="OopsError" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="343" alt="OopsError" src="http://aspzone.com/files/media/image/WindowsLiveWriter/HowtogetWebORBandASP.NETMVCtoworktogeth_8F95/OopsError_thumb.jpg" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I suspected early on that I needed to add an IgnoreRoute statement to the RegisterRoutes method of the global.asax.cs, but was not sure of the exact syntax to use in this case. Since this took me longer than I care to admit to figure out, I’m willing to bet someone else may run into this.&lt;/p&gt;  &lt;p&gt;I first tried to add the following statement:&lt;/p&gt;  &lt;p&gt;routes.IgnoreRoute(&amp;quot;weborb.aspx{*}&amp;quot;);&lt;/p&gt;  &lt;p&gt;That resulted in weborb working, but left routing broken. I got 404 errors for any controller method that had previously worked. I tried several other permutations, but did not get anything to work properly until I found this post from Phil, &lt;a href="http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx" target="_blank"&gt;Make Routing Ignore Requests For A File Extension&lt;/a&gt;. Using the technique that Phil used, I was able to get routing to work properly.&lt;/p&gt;  &lt;p&gt;Here is my final RegisterRoutes method that got me up and running:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RegisterRoutes(RouteCollection routes)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     routes.IgnoreRoute(&lt;span style="color: #006080"&gt;&amp;quot;{*weborb}&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { weborb = &lt;span style="color: #006080"&gt;@&amp;quot;.*weborb\.aspx(/.*)?&amp;quot;&lt;/span&gt; });&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     routes.IgnoreRoute(&lt;span style="color: #006080"&gt;&amp;quot;{resource}.axd/{*pathInfo}&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     routes.MapRoute(&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         &lt;span style="color: #006080"&gt;&amp;quot;Default&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         &lt;span style="color: #006080"&gt;&amp;quot;{controller}/{action}/{id}&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { controller = &lt;span style="color: #006080"&gt;&amp;quot;Home&amp;quot;&lt;/span&gt;, action = &lt;span style="color: #006080"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;, id = &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     );&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2faspzone.com%2ftech%2fhow-to-get-weborb-and-asp-net-mvc-to-work-together%2f"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2faspzone.com%2ftech%2fhow-to-get-weborb-and-asp-net-mvc-to-work-together%2f" border="0" /&gt;&lt;/a&gt;</description><feedburner:origLink>http://aspzone.com/tech/how-to-get-weborb-and-asp-net-mvc-to-work-together/</feedburner:origLink></item><item><title>LOL Cat I could not resist</title><link>http://feedproxy.google.com/~r/aspZone/~3/KSVYfAFb2IQ/</link><pubDate>Fri, 05 Dec 2008 14:56:00 GMT</pubDate><guid isPermaLink="false">http://aspzone.com/misc/lol-cat-i-could-not-resist/</guid><dc:creator>john</dc:creator><slash:comments>0</slash:comments><category domain="http://aspzone.com/misc/">Misc</category><description>&lt;p&gt;I would normally never post an lol cat to my blog. However, this one struck my funny bone so bad that I almost spilt my morning coffee all over my desk.&lt;/p&gt;
&lt;p&gt;&lt;img class="mine_2645517" title="funny-pictures-this-cat-just-ate-a-lemon" alt="funny pictures of cats with captions" src="http://icanhascheezburger.wordpress.com/files/2008/12/funny-pictures-this-cat-just-ate-a-lemon.jpg" /&gt;&lt;br /&gt;
more &lt;a href="http://icanhascheezburger.com"&gt;animals&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><feedburner:origLink>http://aspzone.com/misc/lol-cat-i-could-not-resist/</feedburner:origLink></item></channel></rss>
