Hopefully the above sample provides a simple example of how
you can easily encapsulate useful functionality into extension methods.
Overtime I expect that we'll start to see some nice utility libraries come out
that provide helpful extension methods like above.
I'd be curious to see suggestions for other common scenarios
you think should be packaged up into re-usable extension methods (feel free to use
the comments of this post to suggest them). We can then figure out how to
get a good CodePlex project created that bundles up some of them together
into one library to easily use.
Hope this helps,
P.S. Please check out my Tips/Tricks and Tutorials page to find other useful ASP.NET
and .NET posts I've done.