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

<channel>
	<title>Far Away Developer</title>
	<atom:link href="http://sebastienlachance.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sebastienlachance.com</link>
	<description>Sebastien Lachance</description>
	<pubDate>Tue, 08 Jul 2008 14:54:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>System.Data.Linq.ChangeConflictException: Row not found or changed</title>
		<link>http://sebastienlachance.com/2008/07/08/systemdatalinqchangeconflictexception-row-not-found-or-changed/</link>
		<comments>http://sebastienlachance.com/2008/07/08/systemdatalinqchangeconflictexception-row-not-found-or-changed/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 14:54:08 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Linq]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/07/08/systemdatalinqchangeconflictexception-row-not-found-or-changed/</guid>
		<description><![CDATA[Hummm, gotta love this unclear exception message. I just can&#8217;t believe there is not a condition somewhere to return whether the row was not found or just changed. It would be a lot easier to diagnose problems.
Anyway, after reading several article on concurrency in Linq to SQL and making sure the date was sent correctly [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hummm, gotta love this unclear exception message. I just can&#8217;t believe there is not a condition somewhere to return whether the row was not found or just changed. It would be a lot easier to diagnose problems.</p>
<p>Anyway, after reading several article on concurrency in Linq to SQL and making sure the date was sent correctly (like advised everywhere). I had not pin-pointed the problem until I remembered that I changed a NOT NULL column to a NULL column. Et voila. Problem solved!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/134/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/134/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/134/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=134&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/07/08/systemdatalinqchangeconflictexception-row-not-found-or-changed/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>WCF : Problems and Solutions</title>
		<link>http://sebastienlachance.com/2008/05/22/wcf-problems-and-solutions/</link>
		<comments>http://sebastienlachance.com/2008/05/22/wcf-problems-and-solutions/#comments</comments>
		<pubDate>Thu, 22 May 2008 18:40:40 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/22/wcf-problems-and-solutions/</guid>
		<description><![CDATA[This is a list of various errors you may encounter when working with WCF (Windows Communication Foundation).
Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [].
Add to your service : 

&#60;host&#62;
     &#60;baseAddresses&#62;
        [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is a list of various errors you may encounter when working with WCF (Windows Communication Foundation).</p>
<h3>Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [].</h3>
<p>Add to your service : </p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">host</span><span style="color:#0000ff;">&gt;</span>
     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">baseAddresses</span><span style="color:#0000ff;">&gt;</span>
          <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">add</span> <span style="color:#ff0000;">baseAddress</span><span style="color:#0000ff;">="http://localhost/MyService"</span><span style="color:#0000ff;">/&gt;</span>
     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">baseAddresses</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">host</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<h3>&nbsp;</h3>
<h3>No set method for property &#8216;Message&#8217; in type &#8216;MyProject.MyType.</h3>
<p>A DataContract can&#8217;t have a property with no set method (<a title="http://msdn.microsoft.com/en-us/library/ms733127.aspx" href="http://msdn.microsoft.com/en-us/library/ms733127.aspx">http://msdn.microsoft.com/en-us/library/ms733127.aspx</a>). However, you can use a private set accessor if allowing modification of the property is prohibited. : </p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">[DataMember]
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">object</span> Message
{
    get { <span style="color:#0000ff;">return</span> _message; }
    <span style="color:#0000ff;">private</span> set { _message = <span style="color:#0000ff;">value</span>; }
}</pre>
</div>
<p>&nbsp;</p>
<h3>HTTP could not register URL <a href="http://+:80/MyService/">http://+:80/MyService/</a> because TCP port 80 is being used by another application.</h3>
<p>Happen if IIS is running (very likely!). Change the port to another one. Example : </p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">host</span><span style="color:#0000ff;">&gt;</span>
     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">baseAddresses</span><span style="color:#0000ff;">&gt;</span>
         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">add</span> <span style="color:#ff0000;">baseAddress</span><span style="color:#0000ff;">="http://localhost:8080/MyService"</span><span style="color:#0000ff;">/&gt;</span>
     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">baseAddresses</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">host</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>&nbsp;</p>
<h3>The server was unable to process the request due to an internal error.&nbsp; For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug&gt; configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</h3>
<p>You have an error, but you don&#8217;t get all the details. To get them :</p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">behaviors</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">serviceBehaviors</span><span style="color:#0000ff;">&gt;</span>
       <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">behavior</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">="BasicBehaviorConfiguration"</span><span style="color:#0000ff;">&gt;</span>
          <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">serviceMetadata</span> <span style="color:#ff0000;">httpGetEnabled</span><span style="color:#0000ff;">="true"</span><span style="color:#0000ff;">/&gt;</span>
          <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">serviceDebug</span> <span style="color:#ff0000;">includeExceptionDetailInFaults</span><span style="color:#0000ff;">="true"</span><span style="color:#0000ff;">/&gt;</span>
       <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">behavior</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">serviceBehaviors</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">behaviors</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:61e81cf9-9a1f-491b-8654-3e95507d489f" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/WCF" rel="tag">WCF</a>,<a href="http://technorati.com/tags/WCF%20Errors" rel="tag">WCF Errors</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/133/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/133/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=133&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/22/wcf-problems-and-solutions/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>Type Sharing in Visual Studio 2008</title>
		<link>http://sebastienlachance.com/2008/05/22/type-sharing-in-visual-studio-2008/</link>
		<comments>http://sebastienlachance.com/2008/05/22/type-sharing-in-visual-studio-2008/#comments</comments>
		<pubDate>Thu, 22 May 2008 17:15:17 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Visual Studio]]></category>

		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/22/type-sharing-in-visual-studio-2008/</guid>
		<description><![CDATA[On a previous post called Reality of type sharing in WCF. I talked about a way to use existing types for a WCF service instead of the generated proxies. Previously, we were unable to do that in Visual Studio 2005, but it&#8217;s doable Visual Studio 2008.
Start by adding the library you would use for type [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>On a previous post called <a href="http://sebastienlachance.com/2007/11/13/reality-of-type-sharing-in-wcf/">Reality of type sharing in WCF</a>. I talked about a way to use existing types for a WCF service instead of the generated proxies. Previously, we were unable to do that in Visual Studio 2005, but it&#8217;s doable Visual Studio 2008.</p>
<p>Start by adding the library you would use for type sharing on the project you will add a service reference.</p>
<p>When you add a service reference, click on the <strong>Advanced&#8230;</strong> button.</p>
<p><a title="addservicereference" href="http://www.flickr.com/photos/63483657@N00/2513524151/"><img alt="addservicereference" src="http://static.flickr.com/2084/2513524151_8a09fda71c.jpg" border="0"></a><a title="http://msdn.microsoft.com/en-us/library/bb628653.aspx" href="http://msdn.microsoft.com/en-us/library/bb628653.aspx"></a></p>
<p>&nbsp;</p>
<p>Then, make sure the <strong>Reuse types in referenced assemblies</strong> checkbox is checked.</p>
<p><a title="reusestypes" href="http://www.flickr.com/photos/63483657@N00/2514348648/"><img alt="reusestypes" src="http://static.flickr.com/2294/2514348648_f54603b003.jpg" border="0"></a></p>
<p>You can fine tune further, if you do not want to use some assemblies for type sharing.</p>
<p>And you are done!</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c42040e7-3cb3-4028-beb7-e95d80401123" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/WCF" rel="tag">WCF</a>,<a href="http://technorati.com/tags/Type%20Sharing" rel="tag">Type Sharing</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/132/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/132/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=132&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/22/type-sharing-in-visual-studio-2008/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>

		<media:content url="http://static.flickr.com/2084/2513524151_8a09fda71c.jpg" medium="image">
			<media:title type="html">addservicereference</media:title>
		</media:content>

		<media:content url="http://static.flickr.com/2294/2514348648_f54603b003.jpg" medium="image">
			<media:title type="html">reusestypes</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio 2008 - WCF Templates</title>
		<link>http://sebastienlachance.com/2008/05/21/visual-studio-2008-wcf-templates/</link>
		<comments>http://sebastienlachance.com/2008/05/21/visual-studio-2008-wcf-templates/#comments</comments>
		<pubDate>Wed, 21 May 2008 16:08:43 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/21/visual-studio-2008-wcf-templates/</guid>
		<description><![CDATA[When you want to create a new WCF project, you are presented with 4 different templates to use :

Sequential Workflow Service Library
Syndication Service Library
State Machine Workflow Service Library
WCF Service Library

Each one has it&#8217;s own particularities. It&#8217;s important to know which one to choose but you should know that the template only generate things you need [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When you want to create a new WCF project, you are presented with 4 different templates to use :</p>
<ul>
<li>Sequential Workflow Service Library
<li>Syndication Service Library
<li>State Machine Workflow Service Library
<li>WCF Service Library</li>
</ul>
<p>Each one has it&#8217;s own particularities. It&#8217;s important to know which one to choose but you should know that the template only generate things you need to get started. You can always start from an empty WCF Service Library and build on top of it. Anyway, here is an explanation for each one.</p>
<p>&nbsp;</p>
<h3>Sequential Workflow Service Library</h3>
<p>You basically create a sequential workflow project that made operations available by WCF. I have no experience with Workflow Foundation so I will not go further into details.</p>
<p>&nbsp;</p>
<h3>Syndication Service Library</h3>
<p>This template is great. It present you a way to expose an RSS or Atom feed via a WCF Service contract. This is built-in stuff already present in the framework.</p>
<p>To expose a feed, you need an operation that return a&nbsp; <strong>SyndicationFeedFormatter</strong> (in the System.ServiceModel.Syndication namespace). Then create a <strong>SyndicationFeed</strong> and add <strong>SyndicationItem</strong> to it. Finally, create a <strong>Atom10FeedFormatter</strong> or <strong>Rss20FeedFormatter</strong> and return it.</p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">SyndicationFeed feed = <span style="color:#0000ff;">new</span> SyndicationFeed(<span style="color:#006080;">"Feed Title"</span>, <span style="color:#006080;">"A WCF Syndication Feed"</span>, <span style="color:#0000ff;">null</span>);
List&lt;SyndicationItem&gt; items = <span style="color:#0000ff;">new</span> List&lt;SyndicationItem&gt;();

<span style="color:#008000;">// Create a new Syndication Item.</span>
SyndicationItem item = <span style="color:#0000ff;">new</span> SyndicationItem(<span style="color:#006080;">"An item"</span>, <span style="color:#006080;">"Item content"</span>, <span style="color:#0000ff;">null</span>);
items.Add(item);
feed.Items = items;

<span style="color:#008000;">// Return ATOM or RSS based on query string</span>
<span style="color:#008000;">// rss -&gt; http://localhost:8731/Design_Time_Addresses/SyndicationServiceLibrary1/Feed1/</span>
<span style="color:#008000;">// atom -&gt; http://localhost:8731/Design_Time_Addresses/SyndicationServiceLibrary1/Feed1/?format=atom</span>
<span style="color:#0000ff;">string</span> query = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.QueryParameters[<span style="color:#006080;">"format"</span>];
SyndicationFeedFormatter formatter = <span style="color:#0000ff;">null</span>;
<span style="color:#0000ff;">if</span> (query == <span style="color:#006080;">"atom"</span>)
{
   formatter = <span style="color:#0000ff;">new</span> Atom10FeedFormatter(feed);
}
<span style="color:#0000ff;">else</span>
{
   formatter = <span style="color:#0000ff;">new</span> Rss20FeedFormatter(feed);
}

<span style="color:#0000ff;">return</span> formatter;</pre>
</div>
<h2>&nbsp;</h2>
<h3>State Machine Workflow Service Library</h3>
<p>Another template that expose a Windows Workflow as a Service. This time the type of Workflow is a State Machine. A state machine workflow contrary to a sequential workflow is driven by external events. Transition between states are based on certain events until it reach the final state.</p>
<p><strong></strong>&nbsp;</p>
<h3>WCF Service Library</h3>
<p>The most basic project to create a WCF service. You can use it to do everything you want with the most control.</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:30a47706-c5e7-4cb1-ac8e-cb066919747b" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/WCF" rel="tag">WCF</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/131/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/131/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=131&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/21/visual-studio-2008-wcf-templates/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>Ohhh, that&#8217;s why I should make a TestRepository&#8230;</title>
		<link>http://sebastienlachance.com/2008/05/14/ohhh-thats-why-i-should-make-a-testrepository/</link>
		<comments>http://sebastienlachance.com/2008/05/14/ohhh-thats-why-i-should-make-a-testrepository/#comments</comments>
		<pubDate>Wed, 14 May 2008 17:13:09 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Learning]]></category>

		<category><![CDATA[Tests]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/14/ohhh-thats-why-i-should-make-a-testrepository/</guid>
		<description><![CDATA[Listening to the last screencast of Rob Conery (MVC Storefront) made me realize something that I haven&#8217;t really understood before. 
Suppose you have the interface of a repository, let&#8217;s say IEntryRepository. Then you have the actual SqlEntryRepository and TestEntryRepository. When I am doing TDD, I am testing the TestEntryRepository. But it will not be used [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Listening to the <a href="http://blog.wekeroad.com/mvc-storefront/mvcstore-part-10/">last screencast of Rob Conery (MVC Storefront)</a> made me realize something that I haven&#8217;t really understood before. </p>
<p>Suppose you have the interface of a repository, let&#8217;s say IEntryRepository. Then you have the actual SqlEntryRepository and TestEntryRepository. When I am doing TDD, I am testing the TestEntryRepository. But it will not be used in production. Why bothering with testing it then?</p>
<p>Because TDD is a design process. Even if I am testing my code, I am also designing it. The SqlEntryRepository will benefits from the actual design of the repository we use for testing.</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c5c13d36-5f41-4013-b341-316b0b2cde38" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/tdd" rel="tag">tdd</a>,<a href="http://technorati.com/tags/mvc%20storefront" rel="tag">mvc storefront</a>,<a href="http://technorati.com/tags/rob%20conery" rel="tag">rob conery</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/130/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/130/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=130&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/14/ohhh-thats-why-i-should-make-a-testrepository/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>Alt.NET Podcast</title>
		<link>http://sebastienlachance.com/2008/05/14/altnet-podcast/</link>
		<comments>http://sebastienlachance.com/2008/05/14/altnet-podcast/#comments</comments>
		<pubDate>Wed, 14 May 2008 12:43:24 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/14/altnet-podcast/</guid>
		<description><![CDATA[I have just finished listening to the first episode of a new podcast. It&#8217;s a discussion about self-improvement for developer with Chad Myers, David Laribee and Jeremy D. Miller. It&#8217;s very inspiring and I recommend that you listen to it if you are serious about software development.
Alt.NET Podcast
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have just finished listening to the <a href="http://altnetpodcast.com/episodes/1-continuous-improvement">first episode of a new podcast</a>. It&#8217;s a discussion about self-improvement for developer with Chad Myers, David Laribee and Jeremy D. Miller. It&#8217;s very inspiring and I recommend that you listen to it if you are serious about software development.</p>
<p><a href="http://altnetpodcast.com/">Alt.NET Podcast</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/129/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/129/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=129&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/14/altnet-podcast/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>New code drop to the ASP.NET project on Codeplex</title>
		<link>http://sebastienlachance.com/2008/05/13/new-code-drop-to-the-aspnet-project-on-codeplex/</link>
		<comments>http://sebastienlachance.com/2008/05/13/new-code-drop-to-the-aspnet-project-on-codeplex/#comments</comments>
		<pubDate>Tue, 13 May 2008 12:24:31 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/13/new-code-drop-to-the-aspnet-project-on-codeplex/</guid>
		<description><![CDATA[
05/12 Source code release of the ASP.NET AJAX Script Profiler helper control: To support the ASP.NET AJAX script combining feature which shipped in the .NET Framework 3.5 SP1 Beta release, we&#8217;ve added the ASP.NET AJAX Script Profiler helper control source and binaries to this project. This control helps you to identify the scriptreferences used in [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><blockquote><ul>
<li><b>05/12 Source code release of the ASP.NET AJAX Script Profiler helper control:</b> To support the ASP.NET AJAX script combining feature which shipped in the .NET Framework 3.5 SP1 Beta release, we&#8217;ve added the ASP.NET AJAX Script Profiler helper control source and binaries to this project. This control helps you to identify the scriptreferences used in your ASP.NET AJAX page to use with ASP.NET AJAX script combining. You can find this release here: <a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=13356">ScriptReferenceProfiler Source and Binary Release</a>. In addition this control is used in a Screencast for ASP.NET AJAX script combining on the ASP.NET site. </li>
</ul>
<ul>
<li><b>05/12 Release of the ADO Data Service AJAX Client :</b> The ADO Data Service AJAX Client Library enables you to consume an ADO.NET Data Service from client script in an ASP.NET AJAX Web page. </li>
</ul>
</blockquote>
<p>Read more <a href="http://www.codeplex.com/aspnet">here</a>.</p>
<p>I am really wondering how I can keep up with all these new things to try. Well, I guess we will really need a pill to stop sleeping one day.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/128/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/128/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=128&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/13/new-code-drop-to-the-aspnet-project-on-codeplex/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>My solution node does not appear in Visual Studio 2005 or Visual Studio 2008</title>
		<link>http://sebastienlachance.com/2008/05/13/my-solution-node-does-not-appear-in-visual-studio-2005-or-visual-studio-2008/</link>
		<comments>http://sebastienlachance.com/2008/05/13/my-solution-node-does-not-appear-in-visual-studio-2005-or-visual-studio-2008/#comments</comments>
		<pubDate>Tue, 13 May 2008 12:10:44 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/13/my-solution-node-does-not-appear-in-visual-studio-2005-or-visual-studio-2008/</guid>
		<description><![CDATA[A reader asked me how we can display the solution node in Visual Studio when you have only one project. This feature is turned off by default. What you need to do is to go in your Tools/Options menu and click on Projects and Solutions. Then you need to check the Always Show Solution checkbox. [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://tinyurl.com/3l74od">A reader asked me</a> <strong>how we can display the solution node in Visual Studio</strong> when you have only one project. This feature is turned off by default. What you need to do is to go in your Tools/Options menu and click on <strong>Projects and Solutions</strong>. Then you need to check the Always Show Solution checkbox. </p>
<p><a title="AlwaysShowSolution" href="http://www.flickr.com/photos/63483657@N00/2488713675/"><img alt="AlwaysShowSolution" src="http://static.flickr.com/2375/2488713675_88fe6a6b3a.jpg" border="0"></a></p>
<p>Feel free to ask me any questions. </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/127/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/127/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=127&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/13/my-solution-node-does-not-appear-in-visual-studio-2005-or-visual-studio-2008/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>

		<media:content url="http://static.flickr.com/2375/2488713675_88fe6a6b3a.jpg" medium="image">
			<media:title type="html">AlwaysShowSolution</media:title>
		</media:content>
	</item>
		<item>
		<title>Mocking the HttpRequest in ASP.NET MVC (April build)</title>
		<link>http://sebastienlachance.com/2008/05/12/mocking-the-httprequest-in-aspnet-mvc-april-build/</link>
		<comments>http://sebastienlachance.com/2008/05/12/mocking-the-httprequest-in-aspnet-mvc-april-build/#comments</comments>
		<pubDate>Mon, 12 May 2008 23:36:01 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[Learning]]></category>

		<category><![CDATA[Tests]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/12/mocking-the-httprequest-in-aspnet-mvc-april-build/</guid>
		<description><![CDATA[Like promised, on a previous post, I will show you how to mock HttpRequest. I will use Rhino Mock but you can use the one you want (moq, typemock, etc).
On you controller base class, a property called Request is exposed. Behind the scene you are accessing an HttpContextBase instance (this class is contained in the [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Like promised, on a <a href="http://sebastienlachance.com/2008/05/08/mocking-the-httpcontext-in-aspnet-mvc/">previous post</a>, I will show you how to <strong>mock HttpRequest</strong>. I will use Rhino Mock but you can use the one you want (moq, typemock, etc).</p>
<p>On you controller base class, a property called Request is exposed. Behind the scene you are accessing an HttpContextBase instance (this class is contained in the System.Web.Abstractions library), which is providing you the HttpRequest you want to mock.</p>
<p>So, let&#8217;s start by creating a mock of these two object.</p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">var mocks = <span style="color:#0000ff;">new</span> MockRepository();
var mockedhttpContext = mocks.DynamicMock&lt;HttpContextBase&gt;();
var mockedHttpRequest = mocks.DynamicMock&lt;HttpRequestBase&gt;();</pre>
</div>
<p>&nbsp;</p>
<p>The mockedHttpRequest will be provided by the mockedHttpContext. So we will setup the mocked HttpContextBase.Request property to return the mocked HttpRequestBase.</p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">SetupResult.For(mockedhttpContext.Request).Return(mockedHttpRequest);</pre>
</div>
<p>&nbsp;</p>
<p>But, what would we do with a mocked HttpRequestBase? When you need to test an action on a controller that will retrieve values for the Request.Form property you could create a NameValueCollection and tell the Form property of the HttpRequestBase instance to return it.</p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">NameValueCollection formParameters = <span style="color:#0000ff;">new</span> NameValueCollection();
formParameters.Add(<span style="color:#006080;">"txtUsername"</span>, <span style="color:#006080;">"username"</span>);
formParameters.Add(<span style="color:#006080;">"txtPassword"</span>, <span style="color:#006080;">"password1"</span>);

SetupResult.For(mockedHttpRequest.Form).Return(formParameters);</pre>
</div>
<p>&nbsp;</p>
<p>I really like playing with the ASP.NET MVC framework!!!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/126/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/126/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=126&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/12/mocking-the-httprequest-in-aspnet-mvc-april-build/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>100th Post</title>
		<link>http://sebastienlachance.com/2008/05/09/100th-post/</link>
		<comments>http://sebastienlachance.com/2008/05/09/100th-post/#comments</comments>
		<pubDate>Fri, 09 May 2008 17:47:56 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[Blogging]]></category>

		<category><![CDATA[Fun]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/09/100th-post/</guid>
		<description><![CDATA[100th post. I want to thanks everyone who came visiting me regularly. Over the last year, the amount of visits grew each weeks. I remember when I got the 100 visits mark. Now I am at an average of 120 visits per day with a day of 199 visits. As you can see below, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>100th post. I want to thanks everyone who came visiting me regularly. Over the last year, the amount of visits grew each weeks. I remember when I got the 100 visits mark. Now I am at an average of 120 visits per day with a day of 199 visits. As you can see below, it&#8217;s pretty clear where the weekend is.</p>
<p><a title="BlogStats" href="http://www.flickr.com/photos/63483657@N00/2476374516/"><img src="http://static.flickr.com/2187/2476374516_b29259f40e.jpg" border="0" alt="BlogStats" /></a></p>
<p><a title="BlogsStatsWeek" href="http://www.flickr.com/photos/63483657@N00/2478896244/"><img src="http://static.flickr.com/2071/2478896244_ef86c069d7.jpg" border="0" alt="BlogsStatsWeek" /></a></p>
<p>Here is a gift for you all !!! (I think he had a lot of spare time &#8230;) Enjoy!<br />
<span style="text-align:center; display: block;"><a href="http://sebastienlachance.com/2008/05/09/100th-post/"><img src="http://img.youtube.com/vi/WHpkMiulH84/2.jpg" alt="" /></a></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/125/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/125/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=125&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/09/100th-post/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>

		<media:content url="http://static.flickr.com/2187/2476374516_b29259f40e.jpg" medium="image">
			<media:title type="html">BlogStats</media:title>
		</media:content>

		<media:content url="http://static.flickr.com/2071/2478896244_ef86c069d7.jpg" medium="image">
			<media:title type="html">BlogsStatsWeek</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/WHpkMiulH84/2.jpg" medium="image" />
	</item>
		<item>
		<title>Mocking the HttpContext in ASP.NET MVC</title>
		<link>http://sebastienlachance.com/2008/05/08/mocking-the-httpcontext-in-aspnet-mvc/</link>
		<comments>http://sebastienlachance.com/2008/05/08/mocking-the-httpcontext-in-aspnet-mvc/#comments</comments>
		<pubDate>Thu, 08 May 2008 16:23:36 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[Learning]]></category>

		<category><![CDATA[Tests]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/08/mocking-the-httpcontext-in-aspnet-mvc/</guid>
		<description><![CDATA[I just got a hard time figuring how I could be mocking the HttpContext so that I would be able to mock HttpRequest. But once you understand the principle, it is fairly easy.
First thing we need to know is that the HttpContext is held inside a ControllerContext object. Once we have instantiated one, we can [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just got a hard time figuring how I could be mocking the HttpContext so that I would be able to mock HttpRequest. But once you understand the principle, it is fairly easy.</p>
<p>First thing we need to know is that the HttpContext is held inside a <strong>ControllerContext</strong> object. Once we have instantiated one, we can then put it inside our controller.</p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">controller.ControllerContext = <span style="color:#0000ff;">new</span> ControllerContext(mockedhttpContext, <span style="color:#0000ff;">new</span> RouteData(), controller);</pre>
</div>
<div>&nbsp;</div>
<div>Where mockedHttpContext is your mocked <strong>HttpContextBase</strong> object. </div>
<div>&nbsp;</div>
<div>Inside the HttpContextBase object reside a lot of useful stuff that can replace with our mocks. By example, the HttpRequest, HttpServer, HttpApplication, etc, are all contained inside. So, getting familiar with this basic knowledge is a must to do testing usefully. </div>
<div>&nbsp;</div>
<div>Next post : Mocking HttpRequest.Form to return what we want.</div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/124/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/124/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=124&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/08/mocking-the-httpcontext-in-aspnet-mvc/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>Testing controllers in ASP.NET MVC aka ActionResult</title>
		<link>http://sebastienlachance.com/2008/05/06/testing-controllers-in-aspnet-mvc-aka-actionresult/</link>
		<comments>http://sebastienlachance.com/2008/05/06/testing-controllers-in-aspnet-mvc-aka-actionresult/#comments</comments>
		<pubDate>Tue, 06 May 2008 17:48:35 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/06/testing-controllers-in-aspnet-mvc-aka-actionresult/</guid>
		<description><![CDATA[I haven&#8217;t really done any testing in ASP.NET MVC until now. I started the development of a more serious application and decided to do it TDD. My first test was to make sure the Index action render the Index view. So as an informed developer, I started reading some blog posts to discover that in [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I haven&#8217;t really done any testing in ASP.NET MVC until now. I started the development of a more serious application and decided to do it TDD. My first test was to make sure the Index action render the Index view. So as an informed developer, I started reading some blog posts to discover that in order to test a controller you need to mock a lot of things. I followed the <a href="http://www.asp.net/learn/3.5-extensions-videos/video-271.aspx">screencast of Scott Hanselman</a> and implemented his <a href="http://www.hanselman.com/blog/ASPNETMVCSessionAtMix08TDDAndMvcMockHelpers.aspx">MvcMockHelper</a>. It didn&#8217;t worked. The ViewContext on the view engine remained null, resulting in an NullReferenceException. I downloaded the source of the last build to see for myself what was wrong. Surely I don&#8217;t understand, because nowhere in the source they are setting the ViewContext on the ViewEngine. They just fill a RenderViewResult object and return it back.</p>
<p>This is how I figured out how we can now test controllers. With the new Interim build of the 04/16, we don&#8217;t have to mock the HttpContext, HttpRequest and so on anymore. No need to do a fake view engine and no more mocking needed to test the RenderView method.</p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">[Test]
<span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> Index_Should_Set_The_Index_View()
{
    EntryController controller = <span style="color:#0000ff;">new</span> EntryController();
    var result = (RenderViewResult)controller.Index();

    Assert.That(result.ViewName, Is.EqualTo(<span style="color:#006080;">"Index"</span>));
}</pre>
</div>
<p>So if you have any other operations (RedirectToAction and Redirect for example), it will return an object of type ActionResult that you can cast to the appropriate inheritor (RenderViewResult, ActionRedirectResult, HttpRedirectResult) to get a lot of information that you would have to retrieve manually with a mock.</p>
<p>I really like the simplicity of it and can&#8217;t wait to see more improvement. This is an immense opportunity to learn a great deal of different things.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/123/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/123/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=123&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/06/testing-controllers-in-aspnet-mvc-aka-actionresult/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick Start with ASP.NET MVC 0406 MVC Interim Source Code Release</title>
		<link>http://sebastienlachance.com/2008/05/06/quick-start-with-aspnet-mvc-0406-mvc-interim-source-code-release/</link>
		<comments>http://sebastienlachance.com/2008/05/06/quick-start-with-aspnet-mvc-0406-mvc-interim-source-code-release/#comments</comments>
		<pubDate>Tue, 06 May 2008 17:22:24 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET MVC]]></category>

		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/05/06/quick-start-with-aspnet-mvc-0406-mvc-interim-source-code-release/</guid>
		<description><![CDATA[This is intended to be a quick start for anyone who want to start playing with the latest version of ASP.NET MVC without going through the origin and goals of the MVC pattern. I will use the ASP.NET 0416 MVC Interim Source Code Release for this. Keep in mind, that this will probably all change [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is intended to be a quick start for anyone who want to start playing with the latest version of ASP.NET MVC without going through the origin and goals of the MVC pattern. I will use the ASP.NET 0416 MVC Interim Source Code Release for this. Keep in mind, that this will probably all change in a near future. </p>
<p>First step, download and build the <a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=12640">source</a>. You will need to have the <a href="http://code.google.com/p/moq/">Moq</a> library (more about this mocking framework in a future post).</p>
<p>Second, download and install the <a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=12640">Visual Studio MVC Templates</a> (execute the vsi file).</p>
<p>Third, start an ASP.NET MVC project.</p>
<p>I have two useful resources to share with you. I believe they will give you a head start.</p>
<p>You have the <a href="http://www.asp.net/mvc">Scott Hanselman&#8217;s screencast series</a> on the ASP.NET web site. And you have the <a href="http://blog.wekeroad.com/mvc-storefront/">MVC Storefront series from Rob Conery</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/122/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/122/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=122&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/05/06/quick-start-with-aspnet-mvc-0406-mvc-interim-source-code-release/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>Top 5 most influential peoples on my career</title>
		<link>http://sebastienlachance.com/2008/04/30/top-5-most-influential-peoples-on-my-career/</link>
		<comments>http://sebastienlachance.com/2008/04/30/top-5-most-influential-peoples-on-my-career/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 12:46:35 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/04/30/top-5-most-influential-peoples-on-my-career/</guid>
		<description><![CDATA[I was thinking about this for a while. If I have to choose five peoples who have influenced me the most concerning my career, who would that be?
1. My first supervisor when I was a wielder.
This guy once said to me that I would never do anything more than wielding in my life and if [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was thinking about this for a while. If I have to choose five peoples who have influenced me the most concerning my career, who would that be?</p>
<p><strong>1. My first supervisor when I was a wielder.</strong></p>
<p><em>This guy once said to me that I would never do anything more than wielding in my life and if it wasn&#8217;t for my father, he would have fired me for nothing. I promised him that It will not happen. Four years later, I was the leader of a small team in the company. Take that&#8230;</em></p>
<p><strong>2. <a href="http://www.bernard-voyer.com/index_en.html">Bernard Voyer.</a></strong></p>
<p><em>A famous explorator that I met when I was in school. He believed in his dream and have conquered the Everest, South Pole, North Pole and a lot of hard to reach places. He his just a normal person who gave everything he had to make his dream true.</em></p>
<p><strong>3. The ASP.NET guy.</strong></p>
<p><em>I don&#8217;t remember his name , but it&#8217;s shortly after I finished school. He had just completed a Microsoft Certification in ASP.NET. This is where I first heard the term MCSD and I promised myself I would be one (even though I had no idea what it was at that time). 2 years later, February 7 2006 at almost 9:00 PM, I was one. I learned all by myself with the help of some books and the requirement list on MSDN. It just felt incredible. Even if I&#8217;m no longer in the world of certification, I&#8217;m still very proud of it.</em></p>
<p><strong>4. <a href="http://www.hanselman.com/blog/">Scott Hanselman</a>.</strong></p>
<p><em>First blog ever that I have put in my RSS aggregator. I&#8217;m following him since a long time and he inspired me a lot. It&#8217;s because of him that I am a blogger. He&#8217;s coming to the .NET User Group of Québec next week and I can&#8217;t wait to meet him.</em></p>
<p><strong>5. <a href="http://www.jpboodhoo.com/blog/">Jean-Paul Boodhoo</a></strong> </p>
<p><em>Never met the man. I first heard of him in an episode on DnrTv about design patterns. It seem he has a lot passion&#8230; If you have never heard of him, head here. I wish I was as passionate as him. I am, but he his more :).</em></p>
<p>This was my top 5 of the peoples who had the most impact on me. But I want to talk about a 6th person. He probably don&#8217;t want me to talk about him so I will not give any name. Before meeting him, I was already into Agile development. But he taught me a lot about other aspect of the methodology. Everything that can&#8217;t be learn in a book to be more precise. But thing haven&#8217;t got very well at some point and after a lot of different events we lost touch. Anyway, I am very recognizing to have worked with him.</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1bf27263-ce38-4b0e-88e6-5e9d6a2dcf00" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Scott%20Hanselman" rel="tag">Scott Hanselman</a>,<a href="http://technorati.com/tags/JP%20Boodhoo" rel="tag">JP Boodhoo</a>,<a href="http://technorati.com/tags/Bernard%20Voyer" rel="tag">Bernard Voyer</a>,<a href="http://technorati.com/tags/Top%205" rel="tag">Top 5</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/121/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/121/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=121&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/04/30/top-5-most-influential-peoples-on-my-career/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
		<item>
		<title>var keyword (or Implicitly Typed Local Variables)</title>
		<link>http://sebastienlachance.com/2008/04/17/var-keyword-or-implicitly-typed-local-variables/</link>
		<comments>http://sebastienlachance.com/2008/04/17/var-keyword-or-implicitly-typed-local-variables/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 04:43:28 +0000</pubDate>
		<dc:creator>Sebastien Lachance</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://sebastienlachance.com/2008/04/17/var-keyword-or-implicitly-typed-local-variables/</guid>
		<description><![CDATA[If you are like me and installed the nightly build of Resharper 4, you might have seen the recommendation it made to use the keyword &#8220;var&#8221; almost everywhere. But why?
Here is my answer :
First of all, you must know that the keyword var is not like &#8220;Variant&#8221;. It is not late-bound or loosely typed. The [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you are like me and installed the nightly build of Resharper 4, you might have seen the recommendation it made to use the keyword &#8220;var&#8221; almost everywhere. But why?</p>
<p>Here is my answer :</p>
<p>First of all, you must know that the keyword var is not like &#8220;Variant&#8221;. It is not late-bound or loosely typed. The compiler will be able to infer the type from the right side of the expression. In many case, it&#8217;s optional, but sometime you don&#8217;t have a choice. It&#8217;s the case with Anonymous Types : </p>
<div>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">var customer = <span style="color:#0000ff;">new</span> {ID = 1, Name = <span style="color:#006080;">"Sebastien"</span>, CreditCardNumber = <span style="color:#006080;">"You can dream!"</span>};</pre>
</div>
<div>&nbsp;</div>
<div>It is also often seen with LINQ. </div>
<div>&nbsp;</div>
<div>Should you use it everywhere you can? Well, it&#8217;s a matter of preferences. Mine is to use it only when necessary. If the code is harder to understand when using var, then declare the variable explicitly.</div>
<div>&nbsp;</div>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b7c2d5ae-e385-40c6-8caf-548521011400" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/var" rel="tag">var</a>,<a href="http://technorati.com/tags/C#" rel="tag">C#</a>,<a href="http://technorati.com/tags/Resharper" rel="tag">Resharper</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sebastienlachance.wordpress.com/120/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sebastienlachance.wordpress.com/120/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastienlachance.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastienlachance.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastienlachance.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastienlachance.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastienlachance.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastienlachance.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastienlachance.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastienlachance.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastienlachance.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastienlachance.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastienlachance.com&blog=1225071&post=120&subd=sebastienlachance&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sebastienlachance.com/2008/04/17/var-keyword-or-implicitly-typed-local-variables/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/sebastienlachance-128.jpg" medium="image">
			<media:title type="html">sebastienlachance</media:title>
		</media:content>
	</item>
	</channel>
</rss>