<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: C#&#8217;s Lambda ForEach: Only on Lists?</title>
	<atom:link href="http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:17:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Dan</title>
		<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/comment-page-1/#comment-66227</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 29 Nov 2010 15:24:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=738#comment-66227</guid>
		<description>viewmodel.Lines.ToList().ForEach(f =&gt; { if (f.Line.RowState == Service.RowState.Modified) proxy.UpdateLineAsync(f.Line); });</description>
		<content:encoded><![CDATA[<p>viewmodel.Lines.ToList().ForEach(f =&gt; { if (f.Line.RowState == Service.RowState.Modified) proxy.UpdateLineAsync(f.Line); });</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Chalk</title>
		<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/comment-page-1/#comment-57635</link>
		<dc:creator>Dean Chalk</dc:creator>
		<pubDate>Wed, 27 Oct 2010 14:53:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=738#comment-57635</guid>
		<description>how about 

seleniumClients.Values.ToList().ForEach(client =&gt; client.Stop());</description>
		<content:encoded><![CDATA[<p>how about </p>
<p>seleniumClients.Values.ToList().ForEach(client =&gt; client.Stop());</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Schall</title>
		<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/comment-page-1/#comment-2025</link>
		<dc:creator>Michael Schall</dc:creator>
		<pubDate>Tue, 16 Dec 2008 14:42:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=738#comment-2025</guid>
		<description>Mark - 

We created a extension method almost identical to yours, but returned the collection so you could continue the call chain if you wanted.

Mike</description>
		<content:encoded><![CDATA[<p>Mark &#8211; </p>
<p>We created a extension method almost identical to yours, but returned the collection so you could continue the call chain if you wanted.</p>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darshan</title>
		<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/comment-page-1/#comment-2013</link>
		<dc:creator>Darshan</dc:creator>
		<pubDate>Tue, 16 Dec 2008 06:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=738#comment-2013</guid>
		<description>Why don&#039;t you use:
seleniumClients.Values.ToList().ForEach(client =&gt; client.Stop());</description>
		<content:encoded><![CDATA[<p>Why don&#8217;t you use:<br />
seleniumClients.Values.ToList().ForEach(client =&gt; client.Stop());</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Goodwin</title>
		<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/comment-page-1/#comment-2000</link>
		<dc:creator>Tim Goodwin</dc:creator>
		<pubDate>Mon, 15 Dec 2008 20:32:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=738#comment-2000</guid>
		<description>Rather than reinventing this over and over, some people have started attempting to put this in a common code library.

Check out:
http://www.codeplex.com/nxl
or
http://www.codeplex.com/umbrella

should be what you&#039;re looking for.</description>
		<content:encoded><![CDATA[<p>Rather than reinventing this over and over, some people have started attempting to put this in a common code library.</p>
<p>Check out:<br />
<a href="http://www.codeplex.com/nxl" rel="nofollow">http://www.codeplex.com/nxl</a><br />
or<br />
<a href="http://www.codeplex.com/umbrella" rel="nofollow">http://www.codeplex.com/umbrella</a></p>
<p>should be what you&#8217;re looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fredrik</title>
		<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/comment-page-1/#comment-1996</link>
		<dc:creator>Fredrik</dc:creator>
		<pubDate>Mon, 15 Dec 2008 15:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=738#comment-1996</guid>
		<description>What&#039;s wrong with

foreach(var client in seleniumClients.Values) { client.Stop(); }

?

Yeah, yeah I know - extension methods are cool :)</description>
		<content:encoded><![CDATA[<p>What&#8217;s wrong with</p>
<p>foreach(var client in seleniumClients.Values) { client.Stop(); }</p>
<p>?</p>
<p>Yeah, yeah I know &#8211; extension methods are cool <img src='http://www.markhneedham.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/comment-page-1/#comment-1994</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Mon, 15 Dec 2008 15:03:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=738#comment-1994</guid>
		<description>Good point! Guess I&#039;m still not quite in the mindset of getting the extension methods out there.

I think this does the trick:

    public static class IEnumberableExtensions
    {
        public static void ForEach&lt;T&gt;(this IEnumerable&lt;T&gt; collection, Action&lt;T&gt; action) 
        {
            foreach (var item in collection)
            {
                action(item);
            }
        }
    }</description>
		<content:encoded><![CDATA[<p>Good point! Guess I&#8217;m still not quite in the mindset of getting the extension methods out there.</p>
<p>I think this does the trick:</p>
<p>    public static class IEnumberableExtensions<br />
    {<br />
        public static void ForEach<t>(this IEnumerable</t><t> collection, Action</t><t> action)<br />
        {<br />
            foreach (var item in collection)<br />
            {<br />
                action(item);<br />
            }<br />
        }<br />
    }</t></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Erickson</title>
		<link>http://www.markhneedham.com/blog/2008/12/15/cs-lamba-foreach-only-on-lists/comment-page-1/#comment-1991</link>
		<dc:creator>Aaron Erickson</dc:creator>
		<pubDate>Mon, 15 Dec 2008 14:29:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=738#comment-1991</guid>
		<description>Why not just write an extension method over IEnumerable for your app, like Microsoft apparently forgot to do :)</description>
		<content:encoded><![CDATA[<p>Why not just write an extension method over IEnumerable for your app, like Microsoft apparently forgot to do <img src='http://www.markhneedham.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

