<?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"
	>

<channel>
	<title>willcodeforcoffee.com</title>
	<atom:link href="http://willcodeforcoffee.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://willcodeforcoffee.com</link>
	<description>The personal programming blog of Eric Hoff.</description>
	<pubDate>Wed, 20 Aug 2008 23:56:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>CodeIgniter Thoughts</title>
		<link>http://willcodeforcoffee.com/2008/08/20/codeigniter-thoughts/</link>
		<comments>http://willcodeforcoffee.com/2008/08/20/codeigniter-thoughts/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 23:56:00 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

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

		<guid isPermaLink="false">http://willcodeforcoffee.com/2008/08/20/codeigniter-thoughts/</guid>
		<description><![CDATA[
I&#8217;m finding CodeIgniter a little frustrating right now.&#160; I really wanted to use an MVC tool, but CI is not playing well with IIS.&#160; Also, the documentation really isn&#8217;t that great, even for an open-source project.
Alas, like most PHP projects it just wasn&#8217;t designed or tested with IIS in mind.&#160; Fortunately I&#8217;m discovering this relatively [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>I&#8217;m finding CodeIgniter a little frustrating right now.&#160; I really wanted to use an MVC tool, but CI is not playing well with IIS.&#160; Also, the documentation really isn&#8217;t that great, even for an open-source project.</p>
<p>Alas, like most PHP projects it just wasn&#8217;t designed or tested with IIS in mind.&#160; Fortunately I&#8217;m discovering this relatively early in the project, but I&#8217;m a little frustrated that some of these things are coming up now.</p>
<p>I think given the choice, since the IIS setup was decided for me before, I might have push ASP.NET Forms (vs MVC) instead.&#160; Something I&#8217;ll keep in mind for next time.</p>
<p>Of course, CodeIgniter does work much better on my local Apache development environment.&#160; I don&#8217;t want to come down too hard on it.&#160; I&#8217;m just not impressed with how it works on IIS.</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/08/20/codeigniter-thoughts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP CodeIgniter vs. ASP.NET MVC - My Choice</title>
		<link>http://willcodeforcoffee.com/2008/08/06/php-codeigniter-vs-aspnet-mvc-my-choice/</link>
		<comments>http://willcodeforcoffee.com/2008/08/06/php-codeigniter-vs-aspnet-mvc-my-choice/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 13:13:01 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[C# 3.5 Features]]></category>

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

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

		<guid isPermaLink="false">http://willcodeforcoffee.com/?p=34</guid>
		<description><![CDATA[I think it&#8217;s really great that they&#8217;re building an MVC product for ASP.NET at Microsoft!  I think it has the possibility to bring a lot of PHP, Python and Ruby guys onto the platform.
But it&#8217;s not ready to use yet so I&#8217;m going to use CodeIgniter.  Sure people are out there coding with the beta, [...]]]></description>
			<content:encoded><![CDATA[<p>I think it&#8217;s really great that they&#8217;re building an MVC product for ASP.NET at Microsoft!  I think it has the possibility to bring a lot of PHP, Python and Ruby guys onto the platform.</p>
<p>But it&#8217;s not ready to use yet so I&#8217;m going to use CodeIgniter.  Sure people are out there coding with the beta, or I could even use plain ol&#8217; Web Forms, but long story short: it isn&#8217;t ready.  It&#8217;s going to be awesome when it&#8217;s done, it&#8217;s awesome now, but every new beta brings out breaking changes.</p>
<p>So even though it makes me sad to leave my beloved C# for one site, I&#8217;m gonna have to stick with PHP for this one.</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/08/06/php-codeigniter-vs-aspnet-mvc-my-choice/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Best Practices</title>
		<link>http://willcodeforcoffee.com/2008/07/07/php_best_practices/</link>
		<comments>http://willcodeforcoffee.com/2008/07/07/php_best_practices/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 21:35:18 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

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

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

		<guid isPermaLink="false">http://willcodeforcoffee.com/?p=33</guid>
		<description><![CDATA[I&#8217;ve been coding in PHP for a new client lately, and while PHP doesn&#8217;t have all the glory associated with it that ASP.NET has, nor does it have the compiler or IDE that I love, it is still a fairly decent language to code a website in - but only if you do it right.
For [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been coding in PHP for a new client lately, and while PHP doesn&#8217;t have all the glory associated with it that ASP.NET has, nor does it have the compiler or IDE that I love, it is still a fairly decent language to code a website in - but only if you do it right.</p>
<p>For some reason people LOVE to stick a ton of MySQL queries into the middle of their HTML templates, which are also embedded deeply among more PHP code.  Are you guys kidding me?  The people who do this have obviously never maintained their own code, it&#8217;s just ridiculous to look at or even contemplate maintaining.</p>
<p>OK, maybe this is sounding too angry of a rant, but this is the reason that PHP Programmers have as bad a reputation as VB Programmers.  <em><strong>I</strong></em> sure don&#8217;t want that kind of reputation.</p>
<p>Fortunately there ARE good PHP Programmers out there (no I admit, I&#8217;m not<strong><em> </em></strong>the only one!  <img src='http://willcodeforcoffee.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).  Isn&#8217;t most of Yahoo&#8217;s website infrastructure based around PHP?  <em>They </em>must be writing maintainable, scalable code!  So it must be possible in PHP.</p>
<p>There are lots of good, lightweight frameworks like <a title="CodeIgniter.com" href="http://codeigniter.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/codeigniter.com');" target="_blank">CodeIgniter</a> or <a title="CakePHP.org" href="http://cakephp.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/cakephp.org');" target="_blank">CakePHP</a> available out there.  They&#8217;re easy to learn, easy to use and make your websites far more maintainable by you and people like me.  It should also give you a bit more developer cred, AND help you get your site out there and online faster to boot!</p>
<p>Sorry for the Code Rage, just trying to get the word out!  As with everything, there is a better, easier, faster way, you just have to look for it and use it!</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/07/07/php_best_practices/feed/</wfw:commentRss>
		</item>
		<item>
		<title>So Much For Vacation</title>
		<link>http://willcodeforcoffee.com/2008/07/03/so-much-for-vacation/</link>
		<comments>http://willcodeforcoffee.com/2008/07/03/so-much-for-vacation/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 12:41:36 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[Starting Up]]></category>

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

		<guid isPermaLink="false">http://willcodeforcoffee.com/?p=32</guid>
		<description><![CDATA[And I&#8217;m back at work again!  I got a call from a friend of a friend on Canada Day needing some help with a PHP project.  So it&#8217;s back to the grindstone for me!
]]></description>
			<content:encoded><![CDATA[<p>And I&#8217;m back at work again!  I got a call from a <a title="Division 1" href="http://division1.ca/" onclick="javascript:pageTracker._trackPageview('/outbound/article/division1.ca');">friend</a> of a <a title="CanHaul" href="http://www.canhaul.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.canhaul.com');">friend</a> on Canada Day needing some help with a PHP project.  So it&#8217;s back to the grindstone for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/07/03/so-much-for-vacation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Farewell to Redengine</title>
		<link>http://willcodeforcoffee.com/2008/06/30/farewell-to-redengine/</link>
		<comments>http://willcodeforcoffee.com/2008/06/30/farewell-to-redengine/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 23:55:58 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://willcodeforcoffee.com/2008/06/30/farewell-to-redengine/</guid>
		<description><![CDATA[Today marks the end of a six month contract with Redengine.&#160; It&#8217;s sad to leave, but I wish them the best with their future endeavors!
I&#8217;ll be spending the summer looking for work, working on stuff around the house and on personal programming projects under Hoffsoft Consulting Services Corporation.
]]></description>
			<content:encoded><![CDATA[<p>Today marks the end of a six month contract with <a href="http://redengine.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/redengine.com');" target="_blank">Redengine</a>.&#160; It&#8217;s sad to leave, but I wish them the best with their future endeavors!</p>
<p>I&#8217;ll be spending the summer looking for work, working on stuff around the house and on personal programming projects under <a href="http://hoffsoftcorp.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/hoffsoftcorp.com');" target="_blank">Hoffsoft Consulting Services Corporation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/06/30/farewell-to-redengine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PSake: PowerShell Make</title>
		<link>http://willcodeforcoffee.com/2008/06/30/psake-powershell-make/</link>
		<comments>http://willcodeforcoffee.com/2008/06/30/psake-powershell-make/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 19:16:25 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://willcodeforcoffee.com/2008/06/30/psake-powershell-make/</guid>
		<description><![CDATA[Ever since I first heard about it on the Plumbers @ Work Podcast I&#8217;ve been looking forward to the release of the psake PowerShell build tool James Kovacs was developing.
Looks like one of the first versions have been released.&#160; I&#8217;m excited for two reasons: 1) command-line build tools are always the most powerful tools, 2) [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I first heard about it on the <a href="http://plumbersatwork.com/default.aspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/plumbersatwork.com');" target="_blank">Plumbers @ Work Podcast</a> I&#8217;ve been looking forward to the release of the psake <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.microsoft.com');" target="_blank">PowerShell</a> build tool <a href="http://codebetter.com/blogs/james.kovacs/default.aspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/codebetter.com');" target="_blank">James Kovacs</a> was developing.</p>
<p>Looks like one of the first versions have been released.&#160; I&#8217;m excited for two reasons: 1) command-line build tools are always the most powerful tools, 2) I can use this to learn PowerShell!&#160; <img src='http://willcodeforcoffee.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, thanks to James Kovacs!&#160; I&#8217;m looking forward to trying it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/06/30/psake-powershell-make/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Open / Closed Principle</title>
		<link>http://willcodeforcoffee.com/2008/06/25/the-open-closed-principle/</link>
		<comments>http://willcodeforcoffee.com/2008/06/25/the-open-closed-principle/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 15:41:18 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[.NET]]></category>

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

		<guid isPermaLink="false">http://willcodeforcoffee.com/2008/06/25/the-open-closed-principle/</guid>
		<description><![CDATA[I just read a great article in MSDN Magazine (available online here) on the Open / Closed Principle from the Patterns in Practice column.&#160; I really enjoyed it.&#160; I&#8217;m going to have to spend some more time learning some more design patterns.&#160; I&#8217;ve spent some time learning Model-View-Presenter (MVP) and Inversion of Control (IoC) but [...]]]></description>
			<content:encoded><![CDATA[<p>I just read a great article in MSDN Magazine (available online <a href="http://msdn.microsoft.com/en-ca/magazine/cc546578.aspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/msdn.microsoft.com');" target="_blank">here</a>) on the Open / Closed Principle from the Patterns in Practice column.&#160; I really enjoyed it.&#160; I&#8217;m going to have to spend some more time learning some more design patterns.&#160; I&#8217;ve spent some time learning Model-View-Presenter (MVP) and Inversion of Control (IoC) but haven&#8217;t put either into practice yet.&#160; Who knows what the future holds though?</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/06/25/the-open-closed-principle/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using var And Living With The Consequences</title>
		<link>http://willcodeforcoffee.com/2008/06/20/using-var-and-living-with-the-consequences/</link>
		<comments>http://willcodeforcoffee.com/2008/06/20/using-var-and-living-with-the-consequences/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 23:06:15 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C# 3.5 Features]]></category>

		<guid isPermaLink="false">http://willcodeforcoffee.com/?p=28</guid>
		<description><![CDATA[Another new feature added in C# 3.5 to accommodate anonymous types is the introduction of the var type keyword.&#160; In his Coding Horror blog Jeff Atwood is extolling the virtues of using var to reduce type declaration redundancy.&#160; His example is converting:



StringBuilder sb = new StringBuilder(256);
UTF8Encoding e = new UTF8Encoding();
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();



His point [...]]]></description>
			<content:encoded><![CDATA[<p>Another new feature added in C# 3.5 to accommodate anonymous types is the introduction of the <em><a href="http://msdn.microsoft.com/en-us/library/bb383973.aspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/msdn.microsoft.com');" target="_blank">var</a></em> type keyword.&#160; In his <a href="http://www.codinghorror.com/blog/archives/001136.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.codinghorror.com');" target="_blank">Coding Horror</a> blog Jeff Atwood is extolling the virtues of using var to reduce type declaration redundancy.&#160; His example is converting:</p>
</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:ed0cf444-796c-435c-bb51-002172817e68" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #000000;">StringBuilder sb </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> StringBuilder(</span><span style="color: #800080;">256</span><span style="color: #000000;">);
UTF8Encoding e </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> UTF8Encoding();
MD5CryptoServiceProvider md5 </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> MD5CryptoServiceProvider();
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</p>
<p>into this:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:753422c6-a429-4bd1-a415-abda65ace6ca" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #000000;">var sb </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> StringBuilder(</span><span style="color: #800080;">256</span><span style="color: #000000;">);
var e </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> UTF8Encoding();
var md5 </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> MD5CryptoServiceProvider();
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>His point is that declaring the type as StringBuilder and then <u>assigning it a new StringBuilder</u> is redundant - StringBuilder appears twice on that line of code, before and after the assignment operator (=).&#160; He makes an excellent point because the example using var is far more concise than the original example.&#160; Furthermore, we should be more interested in what is being assigned than what we&#8217;re assigning too (at least on that line of code).&#160; I find when I read the first block my eyes stick on the left-hand side of the assignment, but in the second example I read the right-hand side code instead.</p>
<p>As a side note. the excellent tool <a href="http://www.jetbrains.com/resharper/index.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.jetbrains.com');" target="_blank">ReSharper 4.0</a> suggests using var for <em>every</em> local variable declaration by default.&#160; It&#8217;s one of the first things I changed in ReSharper when I started using it.</p>
<p>You see, I don&#8217;t entirely agree with using var.&#160; Using var is fine, but we aren&#8217;t converting C# into a dynamically typed language like Python or JavaScript - C# is still statically typed, using var just forces the compiler to figure out the type you&#8217;re using, usually based on the first value assigned to it.&#160; In Python or JavaScript I could take sb from the above example and assign to it the UTF8Encoding() object reference on the next line, but C# won&#8217;t let you do that, the compiler will give you an error.</p>
<p>I don&#8217;t like the illusion, so where possible I will use var, but I&#8217;ll keep using types too when necessary for clarity.</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/06/20/using-var-and-living-with-the-consequences/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Application_Error and asmx Web Services</title>
		<link>http://willcodeforcoffee.com/2008/06/20/application_error-and-asmx-web-services/</link>
		<comments>http://willcodeforcoffee.com/2008/06/20/application_error-and-asmx-web-services/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 19:47:11 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://willcodeforcoffee.com/?p=27</guid>
		<description><![CDATA[I just found out after tracking down a weird popup alert error &#8220;Object reference not set to an instance of an object&#8221; that it was being caused inside an ASP.NET asmx web service being called from a ComponentArt grid control.  The web service was causing an exception but it was not caught by Application_Error!
I spent [...]]]></description>
			<content:encoded><![CDATA[<p>I just found out after tracking down a weird popup alert error &#8220;Object reference not set to an instance of an object&#8221; that it was being caused inside an ASP.NET asmx web service being called from a ComponentArt grid control.  The web service was causing an exception but it was not caught by Application_Error!</p>
<p>I spent a few hours trying to find out where on the client the exception was occurring before tracking it to the web service.  I figured nothing was happening on the server since Application_Error didn&#8217;t log the error for me.</p>
<p>So, unless you know something I don&#8217;t know, make sure you add your own error handling to your Web Services.</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/06/20/application_error-and-asmx-web-services/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Finding Common Values in Two Lists in C# Using LINQ</title>
		<link>http://willcodeforcoffee.com/2008/06/19/finding-common-values-in-two-lists-in-c-using-linq/</link>
		<comments>http://willcodeforcoffee.com/2008/06/19/finding-common-values-in-two-lists-in-c-using-linq/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 16:46:59 +0000</pubDate>
		<dc:creator>eric</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://willcodeforcoffee.com/?p=26</guid>
		<description><![CDATA[Finding common values in two lists is simple in .NET 3.5 thanks to LINQ!&#160; I found this example here and here.
In practice here is what I did:


var currentOperatorFacilityIds = from fac in Facility.Facility.ListAllForOperator(this.OperatorId) select fac.ID;
var deleteOperatorFacilityIds = from fac in Facility.Facility.ListAllForOperator(operatorId) select fac.ID;

var commonFacilityIds = currentOperatorFacilityIds.Intersect(deleteOperatorFacilityIds);


]]></description>
			<content:encoded><![CDATA[<p>Finding common values in two lists is <em>simple</em> in .NET 3.5 thanks to LINQ!&#160; I found this example <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336761.aspx#intersect1" onclick="javascript:pageTracker._trackPageview('/outbound/article/msdn.microsoft.com');" target="_blank">here</a> and <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336761.aspx#intersect2" onclick="javascript:pageTracker._trackPageview('/outbound/article/msdn.microsoft.com');" target="_blank">here</a>.</p>
<p>In practice here is what I did:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:3754ea51-ffd2-44e6-882e-7a0c6d200ac1" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; width: 523px; padding-top: 0px">
<pre style="background-color:White;;overflow: none;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #000000;">var currentOperatorFacilityIds </span><span style="color: #000000;">=</span><span style="color: #000000;"> from fac </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> Facility.Facility.ListAllForOperator(</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.OperatorId) select fac.ID;
var deleteOperatorFacilityIds </span><span style="color: #000000;">=</span><span style="color: #000000;"> from fac </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> Facility.Facility.ListAllForOperator(operatorId) select fac.ID;

var commonFacilityIds </span><span style="color: #000000;">=</span><span style="color: #000000;"> currentOperatorFacilityIds.Intersect(deleteOperatorFacilityIds);
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Really simple!&#160; I <em>love</em> LINQ.</p>
]]></content:encoded>
			<wfw:commentRss>http://willcodeforcoffee.com/2008/06/19/finding-common-values-in-two-lists-in-c-using-linq/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
