<?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, 28 Sep 2011 23:00:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Koistya `Navin</title>
		<link>http://goneale.com/2009/02/17/15-helpful-net-extension-methods-to-increase-productivity/comment-page-1/#comment-12797</link>
		<dc:creator>Koistya `Navin</dc:creator>
		<pubDate>Thu, 09 Sep 2010 03:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.wordpress.com/?p=339#comment-12797</guid>
		<description>New Property System and Property Extensions in C# 5.0

http://www.fsguy.com/2010-09-09_property-extensions-in-csharp-5-0</description>
		<content:encoded><![CDATA[<p>New Property System and Property Extensions in C# 5.0</p>
<p><a href="http://www.fsguy.com/2010-09-09_property-extensions-in-csharp-5-0" rel="nofollow">http://www.fsguy.com/2010-09-09_property-extensions-in-csharp-5-0</a></p>
]]></content:encoded>
	</item>
	<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>
</channel>
</rss>

