<?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: 15 Helpful .NET Extension Methods to Increase Productivity</title>
	<atom:link href="http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/feed/" rel="self" type="application/rss+xml" />
	<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/</link>
	<description>Graham O&#039;Neale – Deep In .NET Development: ASP.NET, MVC, jQuery, WPF, WCF, Silverlight</description>
	<lastBuildDate>Wed, 10 Mar 2010 13:27:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Thanks for the review Channel9! &#171; {Programming} &#38; Life</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-128</link>
		<dc:creator>Thanks for the review Channel9! &#171; {Programming} &#38; Life</dc:creator>
		<pubDate>Wed, 25 Feb 2009 12:08:28 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-128</guid>
		<description>[...] (Dan Fernandez and Brian Keller), I really appreciate the video review regarding my post &#8220;15 Helpful .NET Extension Methods to Increase Productivity&#8221; and the plug to my website! The extension methods were nothing [...]</description>
		<content:encoded><![CDATA[<p>[...] (Dan Fernandez and Brian Keller), I really appreciate the video review regarding my post &#8220;15 Helpful .NET Extension Methods to Increase Productivity&#8221; and the plug to my website! The extension methods were nothing [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham O'Neale</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-127</link>
		<dc:creator>Graham O'Neale</dc:creator>
		<pubDate>Mon, 23 Feb 2009 22:59:38 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-127</guid>
		<description>@James: It shouldn&#039;t.  This has been fixed. Cheers dude.</description>
		<content:encoded><![CDATA[<p>@James: It shouldn&#8217;t.  This has been fixed. Cheers dude.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham O'Neale</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-126</link>
		<dc:creator>Graham O'Neale</dc:creator>
		<pubDate>Mon, 23 Feb 2009 22:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-126</guid>
		<description>@Peter: the code should have loaded on the page in source code formatting?  Do you see the scrollable div?</description>
		<content:encoded><![CDATA[<p>@Peter: the code should have loaded on the page in source code formatting?  Do you see the scrollable div?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Curran</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-125</link>
		<dc:creator>James Curran</dc:creator>
		<pubDate>Mon, 23 Feb 2009 22:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-125</guid>
		<description>Why, in ToInt(defaultValue), does a null or empty string convert to 0 instead of defaultValue?</description>
		<content:encoded><![CDATA[<p>Why, in ToInt(defaultValue), does a null or empty string convert to 0 instead of defaultValue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Parker</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-124</link>
		<dc:creator>Peter Parker</dc:creator>
		<pubDate>Sat, 21 Feb 2009 08:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-124</guid>
		<description>Did I miss something? Where are the downloads? I don&#039;t see how I can get your code?! :-/ Please help.</description>
		<content:encoded><![CDATA[<p>Did I miss something? Where are the downloads? I don&#8217;t see how I can get your code?! :-/ Please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham O'Neale</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-109</link>
		<dc:creator>Graham O'Neale</dc:creator>
		<pubDate>Wed, 18 Feb 2009 00:02:44 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-109</guid>
		<description>@Robert: Sorry, I said &lt;em&gt;anything&lt;/em&gt; because I saw the object type input, but the &quot;where T : struct&quot; constraint I understand, nice, as all value types derive from a struct and as you say ref types do not need to be changed. Very cool.</description>
		<content:encoded><![CDATA[<p>@Robert: Sorry, I said <em>anything</em> because I saw the object type input, but the &#8220;where T : struct&#8221; constraint I understand, nice, as all value types derive from a struct and as you say ref types do not need to be changed. Very cool.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Hanlon</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-122</link>
		<dc:creator>Robert Hanlon</dc:creator>
		<pubDate>Tue, 17 Feb 2009 23:46:38 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-122</guid>
		<description>Graham, no, my ToNullable method converts things cast as object to the Nullable&lt;&gt; form of some value type (int, double, bool, and DateTime get the most mileage).  The compiler checks that these are value types with the &quot;where T : struct&quot; constraint.  Reference types, including string, don&#039;t need ToNullable, because those variables can already be set to null.

It&#039;s most effective when reading from the database:

int? imageKey = row[&quot;imagekey&quot;].ToNullable();

(...where &quot;row&quot; is a DataRow, natch.)

It essentially replaces this code:
int? imageKey;
if (row[&quot;imagekey&quot;] == null) imageKey = null;
else imageKey = (int)row[&quot;imageKey&quot;];

It doesn&#039;t solve any groundbreaking problems, but it does clean code up, which is what I find extension methods are best at.</description>
		<content:encoded><![CDATA[<p>Graham, no, my ToNullable method converts things cast as object to the Nullable&lt;&gt; form of some value type (int, double, bool, and DateTime get the most mileage).  The compiler checks that these are value types with the &#8220;where T : struct&#8221; constraint.  Reference types, including string, don&#8217;t need ToNullable, because those variables can already be set to null.</p>
<p>It&#8217;s most effective when reading from the database:</p>
<p>int? imageKey = row["imagekey"].ToNullable();</p>
<p>(&#8230;where &#8220;row&#8221; is a DataRow, natch.)</p>
<p>It essentially replaces this code:<br />
int? imageKey;<br />
if (row["imagekey"] == null) imageKey = null;<br />
else imageKey = (int)row["imageKey"];</p>
<p>It doesn&#8217;t solve any groundbreaking problems, but it does clean code up, which is what I find extension methods are best at.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham O'Neale</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-123</link>
		<dc:creator>Graham O'Neale</dc:creator>
		<pubDate>Tue, 17 Feb 2009 23:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-123</guid>
		<description>@Steve: You bet.  That would be horrible.  No really because I am a consistency freak and I think I just wanted them all three characters.  But then I ruined it with ToBool &amp; ToDateTime anyway....</description>
		<content:encoded><![CDATA[<p>@Steve: You bet.  That would be horrible.  No really because I am a consistency freak and I think I just wanted them all three characters.  But then I ruined it with ToBool &amp; ToDateTime anyway&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham O'Neale</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-121</link>
		<dc:creator>Graham O'Neale</dc:creator>
		<pubDate>Tue, 17 Feb 2009 22:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-121</guid>
		<description>I completely forgot about my HtmlHelperExtensions which were stored in another file! I have just updated my samples.</description>
		<content:encoded><![CDATA[<p>I completely forgot about my HtmlHelperExtensions which were stored in another file! I have just updated my samples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham O'Neale</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-120</link>
		<dc:creator>Graham O'Neale</dc:creator>
		<pubDate>Tue, 17 Feb 2009 22:50:04 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-120</guid>
		<description>@redsquare: Wow, cool redsquare. Thanks for sharing the link.  Hadn&#039;t seen this.

@Rob Packwood: Nice, looks like a great generic implementation for IsBetween().

@Chris: Perhaps.  This was merely a collection of methods I&#039;ve found useful over time and haven&#039;t really looked back on them too much - I&#039;ve never encountered these exceptions so I guess never thought on how they could be improved!

@Robert Hanlon: That&#039;s kinda cool Rob, so it will convert anything to a Nullable type?

@Mark Rasmussen: Yes I see where you&#039;re coming from Mark, but I don&#039;t think there is a reason to dislike it.  When I say that, it is from my perspective and my disciplines, I would use it intentionally as a &quot;convenience&quot; to Convert.ToInt32() and it should be no less thought out than if you were to use the original convert method. I&#039;ve been working with a lot of legacy systems of late, cutting up files and such, so I have found the ToInt() method personally incredibly useful with what I needed to do.</description>
		<content:encoded><![CDATA[<p>@redsquare: Wow, cool redsquare. Thanks for sharing the link.  Hadn&#8217;t seen this.</p>
<p>@Rob Packwood: Nice, looks like a great generic implementation for IsBetween().</p>
<p>@Chris: Perhaps.  This was merely a collection of methods I&#8217;ve found useful over time and haven&#8217;t really looked back on them too much &#8211; I&#8217;ve never encountered these exceptions so I guess never thought on how they could be improved!</p>
<p>@Robert Hanlon: That&#8217;s kinda cool Rob, so it will convert anything to a Nullable type?</p>
<p>@Mark Rasmussen: Yes I see where you&#8217;re coming from Mark, but I don&#8217;t think there is a reason to dislike it.  When I say that, it is from my perspective and my disciplines, I would use it intentionally as a &#8220;convenience&#8221; to Convert.ToInt32() and it should be no less thought out than if you were to use the original convert method. I&#8217;ve been working with a lot of legacy systems of late, cutting up files and such, so I have found the ToInt() method personally incredibly useful with what I needed to do.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
