Languages - DevSource
DevSource: Microsoft Developer Resource DevSource Home Sponsored by Microsoft Home Add Ons Architecture Languages Techniques Using VS Forums
Home arrow Languages arrow Page 3 - Implementing Extension Methods in C#
Implementing Extension Methods in C#
By Paul Kimmel

Rate This Article: Add This Article To:

Implementing Extension Methods in C#
( Page 3 of 3 )

 

Summary

Extension methods are a fascinating and new aspect of .NET programming. Extension methods permit extending the behaviors of classes without inheritance which in some cases is impossible. For example, sealed classes cannot be inherited from. In this article a simple extension method that dumps an object’s state and another generic extension method that extends IDataReader were demonstrated.

ADVERTISEMENT

On a side note extension methods are at the heart of the new technology, LINQ. Extension methods are the underpinnings for the ability to query enumerable objects. Check out my book LINQ Unleashed: for C# for a comprehensive examination of extension methods and LINQ.

Biography

Paul Kimmel is the VB Today columnist for HYPERLINK "http://www.codeguru.com/" \t "new" www.codeguru.com and has written several books on object-oriented programming and .NET. Check out his upcoming book LINQ Unleashed for C# due July 2008. Paul is an application architect for Electronic Data Systems in Lansing, Michigan. You may contact him for technology questions at pkimmel@softconcepts.com.

If you are interested in joining or sponsoring a .NET Users Group, check out www.glugnet.org. Glugnet opened a users group branch in Flint, Michigan in August 2007. If you are interested in attending, check out the www.glugnet.org web site for updates.



 
 
>>> More Languages Articles          >>> More By Paul Kimmel
 



DevSource video
Devsource Video Series
Manipulating Society through Technology
Jeremy Bailenson, Director of the Virtual Human Interaction Lab at Stanford University, talks about virtual reality, avatars, Moore's law, how real world behaviors influence online reality, and societal manipulation through technology!
>> Play video
>> Read article
>> See all videos
DevLife Blog

Julia explores the Robotics Studio! (It's for more than you think.)

MSDev Blog

Messages for Bill Gates!

Make it Work
.NET makes runtime type checking a breeze. See what Peter has to say about it in this week's tips!
News
Microsoft Counts on App Support for Vista
Microsoft has taken pains to demonstrate that Windows Vista will have ample application support.
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.